在使用高版本vs 编译MFC的 WINVER and _WIN32_WINNT版本问题

转载:http://msdn.microsoft.com/en-us/library/6sehtctf.aspx

Modifying WINVER and _WIN32_WINNT

Visual Studio 2010
1 out of 1 rated this helpful Rate this topic

Visual C++ no longer supports targeting Windows 95, Windows 98, Windows ME, or Windows NT. If your WINVER or _WIN32_WINNT macros are assigned to one of these versions of Windows, you must modify the macros. When you upgrade a project that was created by using an earlier version of Visual C++, you may see compilation errors related to the WINVER or _WIN32_WINNT macros if they are assigned to a version of Windows that is no longer supported.

To modify the macros, in a header file, add the following lines.

#define WINVER 0x0500
#define _WIN32_WINNT 0x0500

This targets the Windows 2000 operating system. Other valid values include 0x0501 for Windows XP, 0x0502 for Windows Server 2003, 0x0600 for Windows Vista, and 0x0601 for Windows 7.

NoteNote

Values are not guaranteed to work if you include internal MFC headers in your application. For example, Windows 2000 is not supported in afximpl.h.

You can also define this macro by using the /D compiler option. For more information, see /D (Preprocessor Definitions).

For more information about the meanings of these macros, see Using the Windows Headers.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值