The main steps are as follows:
1. Create a new dynamic link library project and add the class declaration and definition files to it;
Note that the declspec (dllexport) modifier must be used in the declaration of class member functions. This modifier can export methods in this DLL for other applications.Program.
2. Create an application that references the dynamic link library;
To use a member function created in the dynamic link library, you must reference the dynamic link library. Select the project that calls the DLL, select "Reference" from the "project" menu, and find the project directory corresponding to the dynamic link library.
To reference the header file of the dynamic link library, you must modify the directory path. Find the path of the DLL header file in "add include directory.
The executable file only loads the dynamic link library at runtime. You must tell the system where to find the DLL and use the PATH variable to point out the path of the. dll file.
3. In the application that calls the DLL, use the member function in the Custom DLL just like other DLL provided by the system.
Follow the steps in msdn:
Http://msdn.microsoft.com/zh-cn/vstudio/ms235636.aspx