zoukankan      html  css  js  c++  java
  • 控制台应用程序中添加对MFC的支持

    在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

     

  • 相关阅读:
    android开发学习4
    macOS login: Could not determine audit condition 问题解决
    java代码编程规范
    学习进度报告(二)
    学习进度报告(一)
    android开发笔记
    数组
    软件工程第二周开课博客
    第一周学习总结
    用户体验评价
  • 原文地址:https://www.cnblogs.com/cmranger/p/4077626.html
Copyright © 2011-2022 走看看