控制台应用程序中添加对MFC的支持
2014-11-05 23:37
281 查看
在windows控制台应用程序中,肯能会想使用一些MFC中的类,如CStringArray等,通过下面两步简单的设置可以添加对MFC的支持:
1、右击工程名 -> References 选择 All Configuration
->Configuration Properties ->General->Use of MFC ->Use MFC in a Shared DLL
2、在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
1、右击工程名 -> References 选择 All Configuration
->Configuration Properties ->General->Use of MFC ->Use MFC in a Shared DLL
2、在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
相关文章推荐
- VS2010如何在控制台应用程序中添加对MFC库的支持
- 在编写控制台应用程序时,且要用MFC框架时添加的头文件
- MFC应用程序中添加控制台窗口
- MFC应用程序中添加控制台窗口
- 控制台程序中添加mfc支持
- 2步让Win32应用程序/控制台应用使用MFC类库支持显示对话框
- 向MFC应用程序添加控制台窗口
- MFC中给应用程序添加托盘支持
- 向MFC应用程序添加控制台窗口
- 在应用程序中添加宏支持的注意事项(Update)
- MFC 基于CView的应用程序添加滚动条
- 如何导出wince6.0的SDK 添加MFC支持
- 给 ATL EXE 项目添加 MFC 支持
- 建立一个控制台应用程序向应用程序添加一个学生类,至少包含学号和成绩两个成员
- 如何导出wince6.0的SDK 添加MFC支持
- c# windows应用程序或C# 控制台应用程序 添加web引用步骤
- 为MFC程序添加控制台窗口
- 为MFC应用程序添加全屏幕显示功能
- 如何向 MFC EXE 添加 ATL 支持
- HOWTO: 给 ATL 项目添加 MFC 支持