win32程序增加mfc支持

首先,在 stdafx.h中,屏蔽掉 #include<windows.h>

然后在 stdafx.h中加入

#ifndef VC_EXTRALEAN 
#define VC_EXTRALEAN        // 从 Windows 头中排除极少使用的资料 #endif  
#include <afx.h> 
#include <afxwin.h>         // MFC 核心组件和标准组件 #include <afxext.h>         // MFC 扩展  
#endif

如果编译出现

error LNK2005: _DllMain@12 已经在 dllmain.obj 中定义

那么就在dllmain.cpp中加入

// The following symbol used to force inclusion of this module for _USRDLL
#ifdef _X86_
extern "C" { int _afxForceUSRDLL; }
#else
extern "C" { int __afxForceUSRDLL; }
#endif

用来强制执行用户自己定义的main函数

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值