用VC.NET 2003 的向导生成一个Win32程序,会在stdafx.h里看到如下一堆有关版本的定义。我的问题是:1,它 们 分 别 控 制 的 是 哪 方 面 的 版 本 ?2,为 什 么 有 这 么 多 该 死 的 版 本 定 义 ?3,它 们 分 别 都 有 哪 些 合 法 的 值 可 用 ?谢谢!谢谢!谢谢!// 如果您必须使用下列所指定的平台之前的平台,则修改下面的定义。
// 有关不同平台的相应值的最新信息,请参考 MSDN。
#ifndef WINVER // 允许使用 Windows 95 和 Windows NT 4 或更高版本的特定功能。
#define WINVER 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif#ifndef _WIN32_WINNT // 允许使用 Windows NT 4 或更高版本的特定功能。
#define _WIN32_WINNT 0x0400 //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif #ifndef _WIN32_WINDOWS // 允许使用 Windows 98 或更高版本的特定功能。
#define _WIN32_WINDOWS 0x0410 //为 Windows Me 及更新版本改变为适当的值。
#endif#ifndef _WIN32_IE // 允许使用 IE 4.0 或更高版本的特定功能。
#define _WIN32_IE 0x0400 //为 IE 5.0 及更新版本改变为适当的值。
#endif

解决方案 »

  1.   

    When you build an MFC project from a previous release in Visual C++ .NET, you may see compilation errors due to the fact that your project is now using a different value for WINVER.When your project was being built in a previous version of Visual C++, WINVER may have been set to 400, to allow compilation using an earlier version of Platform SDK header files, such as may have been found on Windows 95 or Windows NT 4.0.You may have implicitly gotten your WINVER=400 setting in one of two ways:    * By using the earlier version of the Platform SDK header files that were available with the earliest versions of Visual C++ 6.0.
        * By including winres.h in your Visual C++ 6.0 project. This file contained a definition of 400 for WINVER.If you got your WINVER=400 setting by either of these means, if you still need WINVER=400 to be set, and if your project is now getting compiler errors in Visual C++ .NET, you need to explicitly define WINVER=400. For example, in a header file, you could add the following line:#define  WINVER  0x0400
      

  2.   

    Minimum system required  Macros to define
    Windows Server 2003 family  _WIN32_WINNT>=0x0502WINVER>=0x0502
    Windows XP  _WIN32_WINNT>=0x0501WINVER>=0x0501
    Windows 2000  _WIN32_WINNT>=0x0500WINVER>=0x0500
    Windows NT 4.0  _WIN32_WINNT>=0x0400WINVER>=0x0400
    Windows Me  _WIN32_WINDOWS=0x0500WINVER>=0x0500
    Windows 98  _WIN32_WINDOWS>=0x0410WINVER>=0x0410
    Windows 95  _WIN32_WINDOWS>=0x0400WINVER>=0x0400
    Internet Explorer 6.0  _WIN32_IE>=0x0600
    Internet Explorer 5.6  _WIN32_IE>=0x0560
    Internet Explorer 5.01, 5.5  _WIN32_IE>=0x0501
    Internet Explorer 5.0, 5.0a, 5.0b  _WIN32_IE>=0x0500
    Internet Explorer 4.01  _WIN32_IE>=0x0401
    Internet Explorer 4.0  _WIN32_IE>=0x0400
    Internet Explorer 3.0, 3.01, 3.02  _WIN32_IE>=0x0300
      

  3.   

    贴出来排版都变了,看这里:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog/using_the_windows_headers.asp