参考:http://wangeleven.blog.163.com/blog/static/2437003920071134263366/
http://wangeleven.blog.163.com/blog/static/2437003920071134263366/
测试环境:VC2010
1、在stdafx.h
// Windows 头文件:
#include <windows.h> 之前加入 #include <afx.h>
2、dllmain.cpp
加入:
//使用MFC库 http://blog.csdn.net/lys07962000/article/details/42098559
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define new DEBUG_NEW
// global data
// The following symbol used to force inclusion of this module for _USRDLL
#ifdef _X86_
extern "C" { int _afxForceUSRDLL; }
#else
extern "C" { int __afxForceUSRDLL; }
#endif
///使用MFC库
3、工程属性--》C/C++--》代码生产--》运行库 改为:多线程调试(/MTD)