this article is writen by PJ Naughter.it explaining about this. Header File Conventions This SDK can be used to target applications for Microsoft? Windows? 95, Microsoft? Windows NT? 4.0, Microsoft? Windows? 98, and Microsoft? Windows? 2000 using the header file conventions below. The makefiles generated by Microsoft? Visual C++? 5.0 and 6.0 target Windows NT 3.51 by default. Therefore, to use functions introduced in Windows NT 4.0 or later, which are protected by conditional code, you must define the appropriate macros. Otherwise, you will receive the following error message from the compiler: error C2065: undeclared identifier. You may also need to ensure that the INCLUDE environment variables has the path to the SDK header files listed before the path to the Visual C++ header files. Otherwise, you will receive error C2065 for items that were introduced after Visual C++ was released. The following table indicates the macros you must define to target each system using the SDK headers.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 and Windows 2000 WINVER=0x0500 Windows 2000 _WIN32_WINNT=0x0500 and WINVER=0x0500 Internet Explorer 3.0 _WIN32_IE=0x0300 Internet Explorer 4.0 _WIN32_IE=0x0400 Internet Explorer 5.0 _WIN32_IE=0x0500 Note: Setting WINVER to 0x0500 implies _WIN32_IE=0x0400.If you are writing your own makefile, the macros in WIN32.MAK can help you use the correct conventions. The value of _WIN32_WINNT is set in WIN32.MAK, depending on the platform you choose to target. By default, WIN32.MAK defines _WIN32_WINNT as 0x0400. By default, WIN32.MAK sets _WIN32_IE to 0x0300 if it is not already defined. To take advantage of the new features introduced in Internet Explorer 4.0, such as new common controls, define _WIN32_IE as 0x0400. For more information, see Building Applications Using WIN32.MAK. If you do not include WIN32.MAK in your makefile, you need to explicitly define _WIN32_WINNT as 0x0500 to get the Windows 2000-specific material from the header files.The SDK headers use guard statements to determine the system on which each function is supported. The following table describes these statements.Guard Statement Meaning #if _WIN32_WINNT >= 0x0400 Windows NT 4.0 and later. It is not implemented in Windows 95. #if _WIN32_WINDOWS >= 0x0410 Windows 98. The image may not run on Windows 95. #if _WIN32_WINNT >= 0x0500 Windows 2000. The image may not run on Windows 95/98 or Windows NT. #if WINVER >= 0x0500 Windows 2000 and Windows 98. The image may not run on Windows 95 or Windows NT. #if _WIN32_IE >= 0x0300 Internet Explorer 3.0 and later. #if _WIN32_IE >= 0x0400 Internet Explorer 4.0 and later. #if _WIN32_IE >= 0x0500 Internet Explorer 5.0 and later.
更新 Microsoft SDK 就可以了,VC 6 自带的 SDK 定义#define _WIN32_IE 0x0400
Header File Conventions
This SDK can be used to target applications for Microsoft? Windows?
95, Microsoft? Windows NT? 4.0, Microsoft? Windows? 98, and Microsoft?
Windows? 2000 using the header file conventions below. The makefiles generated by Microsoft? Visual C++? 5.0 and 6.0 target
Windows NT 3.51 by default. Therefore, to use functions introduced in
Windows NT 4.0 or later, which are protected by conditional code, you
must define the appropriate macros. Otherwise, you will receive the
following error message from the compiler: error C2065: undeclared
identifier. You may also need to ensure that the INCLUDE environment
variables has the path to the SDK header files listed before the path
to the Visual C++ header files. Otherwise, you will receive error
C2065 for items that were introduced after Visual C++ was released. The following table indicates the macros you must define to target
each system using the SDK headers.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 and Windows 2000 WINVER=0x0500
Windows 2000 _WIN32_WINNT=0x0500 and WINVER=0x0500
Internet Explorer 3.0 _WIN32_IE=0x0300
Internet Explorer 4.0 _WIN32_IE=0x0400
Internet Explorer 5.0 _WIN32_IE=0x0500
Note: Setting WINVER to 0x0500 implies _WIN32_IE=0x0400.If you are writing your own makefile, the macros in WIN32.MAK can help
you use the correct conventions. The value of _WIN32_WINNT is set in
WIN32.MAK, depending on the platform you choose to target. By default,
WIN32.MAK defines _WIN32_WINNT as 0x0400. By default, WIN32.MAK sets
_WIN32_IE to 0x0300 if it is not already defined. To take advantage of
the new features introduced in Internet Explorer 4.0, such as new
common controls, define _WIN32_IE as 0x0400. For more information, see
Building Applications Using WIN32.MAK. If you do not include WIN32.MAK in your makefile, you need to
explicitly define _WIN32_WINNT as 0x0500 to get the Windows
2000-specific material from the header files.The SDK headers use guard statements to determine the system on which
each function is supported. The following table describes these
statements.Guard Statement Meaning
#if _WIN32_WINNT >= 0x0400 Windows NT 4.0 and later. It is not
implemented in Windows 95.
#if _WIN32_WINDOWS >= 0x0410 Windows 98. The image may not run on
Windows 95.
#if _WIN32_WINNT >= 0x0500 Windows 2000. The image may not run on
Windows 95/98 or Windows NT.
#if WINVER >= 0x0500 Windows 2000 and Windows 98. The image may not
run on Windows 95 or Windows NT.
#if _WIN32_IE >= 0x0300 Internet Explorer 3.0 and later.
#if _WIN32_IE >= 0x0400 Internet Explorer 4.0 and later.
#if _WIN32_IE >= 0x0500 Internet Explorer 5.0 and later.