您的位置:首页 > 其它

VS2010如何在控制台应用程序中添加对MFC库的支持

2013-10-19 22:16 405 查看
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 // some CString constructors will be explicit

#ifndef VC_EXTRALEAN

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

#endif

#include <afx.h>

#include <afxwin.h> // MFC core and standard components

#include <afxext.h> // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT

#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls

#endif

#ifndef _AFX_NO_AFXCMN_SUPPORT

#include <afxcmn.h> // MFC support for Windows Common Controls

#endif // _AFX_NO_AFXCMN_SUPPORT

完成!!!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: