DllTest.rar dll1.h #ifdef DLL1_API#else#define DLL1_API _declspec(dllimport) #endifDLL1_API int add(int a,int b);DLL1_API int sub (int a,int b);class DLL1_API PO //导出整个类; dll1.cpp #define DLL1_API _declspec(dllexport)#include "Dll1.h"int add(int a,int b)} 调用程序只要包含同文件与lib库文件就可以直接使用了 #include "..\DLLPJ\Dll1.h"。。。。。 CString str; str.Format("%d",add(5,3)); AfxMessageBox(str); 相关文章: