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