First step: Open VS2010
Step Two: Use the wizard to create a WIN32 console program. Note Select the DLL and the empty program.
Step Three: Use the wizard to add a file named Mian.c to the source file.
Fourth step: Add code.
#include <windows.h>//add a header file or the compiler doesn't know what your int is. variable of type int_declspec (dllexport)//The point here _declspec is that Microsoft's proprietary modifier is for the compiler to see. _declspec is a very large concept. PlusDoubleIn1,DoubleIn2,Double* out){ * out= in1+in2; return 0;}/*dllimport,dllexport: Format: __declspec (dllimport) declarator__declspec (dllexport) declarator is used to import functions from DLLs, data, or objects as well as exported functions, data, or objects from the DLL. Equivalent to the interface that defines the DLL, defines the functions, data, or objects that can be used for its client EXE or DLL. Declaring a function as dllexport eliminates the definition of the module definition (. DEF) file. Dllexport replaced the __export keyword. The function names that are exported by C + + functions declared as dllexport are processed according to C + + rules. If you require name processing that does not follow C + + rules, use a. def file or use extern "C". */
Fifth Step: Compiling
Connection
Create a dynamic library step-by-step