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


转自: 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的头文件加入如下代码:

 1 #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS        // some CString constructors will be explicit
 2 
 3 #ifndef VC_EXTRALEAN #define VC_EXTRALEAN            // Exclude rarely-used stuff from Windows headers #endif
 4 
 5 #include <afx.h> #include <afxwin.h>             // MFC core and standard components
 6 
 7 #include <afxext.h>                     // MFC extensions #ifndef _AFX_NO_OLE_SUPPORT
 8 
 9 #include <afxdtctl.h>                     // MFC support for Internet Explorer 4 Common Controls
10 
11 #endif
12 
13 #ifndef _AFX_NO_AFXCMN_SUPPORT
14 
15 #include <afxcmn.h>                           // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM