在将VC6.0程序转换成VS2010之后,弹出此错误,有两种方法可以解决此问题,根据具体情况设定,呵呵
(1)修改stdafx.h中信息,如下所示
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxcview.h>
修改如下:
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define _WIN32_WINNT 0x0501 //可根据系统类型设定
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxcview.h>
(2)通过项目“属性管理器”属性页设置
第一步:打开“C/C++”中“预处理器”,选中“预处理定义”项,如图所示:

第二步:点击“编辑”按钮,弹出“预处理定义”编辑框,修改“_WIN32_WINNT”的值,点击确定即可。

本文介绍了将Visual C++ 6.0项目迁移至Visual Studio 2010过程中遇到的错误及两种解决方法。一是修改stdafx.h文件中的_WIN32_WINNT宏定义;二是通过项目属性管理器预处理器定义进行调整。
1352

被折叠的 条评论
为什么被折叠?



