#define WINVER 0x0500
这是我在一个程序见到的,0x500是什么意思?
如果程序没有这条语句,就会出错,但在整个程序中根本没用到WINVER.
这段程序出自<Windows程序设计 第五版>(Charles Petzold )第四章中的SysMets1.c

解决方案 »

  1.   

    应该是windows版本winnt 5.0也就是win2k吧
      

  2.   

    表示是win2000为了保证有些函数需要在win2000下用,定义这个宏。
      

  3.   

    Minimum System Required  Macros to Define 
    Windows 95 and 
    Windows NT 4.0            WINVER=0x0400 
    Windows 98 and 
    Windows NT 4.0           _WIN32_WINDOWS=0x0410 and WINVER=0x0400 
    Windows NT 4.0           _WIN32_WINNT=0x0400 and WINVER=0x0400 
    Windows 98              _WIN32_WINDOWS=0x0410 
    Windows 2000            _WIN32_WINNT=0x0500 and WINVER=0x0500 
    Windows Me             _WIN32_WINDOWS=0x0490 
    Windows XP and 
    Windows .NET Server        _WIN32_WINNT=0x0501 and WINVER=0x0501 
    Internet Explorer 3.0, 3.01, 3.02  _WIN32_IE=0x0300 
    Internet Explorer 4.0 _WIN32_IE=0x0400 
    Internet Explorer 4.01 _WIN32_IE=0x0401 
    Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE=0x0500 
    Internet Explorer 5.01, 5.5 _WIN32_IE=0x0501 
    Internet Explorer 6.0 _WIN32_IE=0x0560 or
    _WIN32_IE=0x0600 
      

  4.   

    奇怪了,我这样写居然也可以运行成功:
    #define WINVER 0x0600
      

  5.   

    指定程序所运行的Windows版本。
    0X500指NT5,就是2K,
      

  6.   

    是用于定义windows版本号的,用于区分不用版本系统的函数。
    在你编译程序时会根据不同的版本系统号,链接不同的函数定义#define WINVER 0x0600在目前情况下基本能用,因为在头文件中都是进行如下的判断
    #if (WINVER >= 0X500)
      ......
    #else
      ......
    #endif
      

  7.   

    是定义Windows的版本号
    比如如下语句:#if _MSC_VER >= 1200
    void PASCAL operator delete(void* p, void* pPlace);
    #endif#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000