以下内容,我看了多篇文章,整合在一起,写的一个例子,关于dll工程的创建,请参考博客里另一篇文章:http://www.cnblogs.com/pingge/articles/3153571.html 有什么不对的欢迎指正!!! 1.头文件 //testdll.h #ifndef _TESTDLL_H_ #define _TESTDLL_H_ namespace MathFuncs { // This class is exported from the testdll.dll // Retur
DLL中导出函数的声明有两种方式: 1.在函数声明中加上__declspec(dllexport) //以下内容为 .h 文件中的内容 //向外界提供的端口 extern"C" _declspec(dllexport) int _stdcall Test1(int M, int N); extern"C" _declspec(dllexport) int _stdcall Test2(int M, int N); //端口函数的声明 int _stdcall Tes
动态链接库DLL_Sample.dll DLL_Sample.h:#ifdef TEST_API# define TEST_API _declspec(dllexport)#else# define TEST_API _declspec(dllimport)#endif TEST_API int fuc(int a);TEST_API int fuc(int a, int b);TEST_API int fuc(int a, int b, int c);DLL_Sample.cpp:#defin