APP类无需导出去,你在项目中添加了类CCommonCls
则在stdafx.h中添加
#define DLLCLASS_EXPORT __declspec(dllexport)
在CommonCls.h中写
#ifndef DLLCLASS_EXPORT
#define DLLCLASS_EXPORT __declspec(dllimport)
#pragma comment(lib,"CommonCls.lib")
#pragma message("Automatically linking with CommonCls.dll")
#endif
class DLLCLASS_EXPORT CCommonCls
{
......
};
在其他项目中,只需把该头文件CommonCls.h考贝过去包含就可以用了。lib文件考过去。