http://blog.sina.com.cn/s/blog_5f656a170101dzcn.html
1:右击工程名 -> References
2:Configuration Properties ->Use of MFC ->Use MFC in a Shared DLL
3:在stdafx.h的头文件加入如下代码:
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN
#endif
#include <afx.h>
#include <afxwin.h>
#include <afxext.h>
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h>
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>
#endif // _AFX_NO_AFXCMN_SUPPORT
完成!!!