Setting WINVER or _WIN32_WINNT
You can define these symbols by using the #define statement in each source file, or by specifying the /D compiler option supported by Visual C++.
For example, to set WINVER in your source file, use the following statement:
#define WINVER 0x0502
To set _WIN32_WINNT in your source file, use the following statement:
#define _WIN32_WINNT 0x0502
To set _WIN32_WINNT using the /D compiler option, use the following command:
cl -c -D_WIN32_WINNT=0x0502 source.cpp
For information on using the /D compiler option, see /D (preprocessor definitions).
Note that some features introduced in the latest version of Windows may be added to a service pack for a previous version of Windows. Therefore, to target a service pack, you may need to define _WIN32_WINNT with the value for the next major operating system release. For example, the GetDllDirectory function was introduced in Windows Server 2003 and is conditionally defined if _WIN32_WINNT is 0x0502 or greater. This function was also added to Windows XP with SP1. Therefore, if you were to define _WIN32_WINNT as 0x0501 to target Windows XP, you would miss features that are defined in Windows XP with SP1.
특정 버전 이상에서만 다르게 컴파일 할때
//InitializeCriticalSectionAndSpinCount 는 Server 2003 나 xp 이상부터 지원 #if (_WIN32_WINNT >=0x0501) ::InitializeCriticalSectionAndSpinCount(&cs_, 4000); #else ::InitializeCriticalSection(&cs_); #endif
버전정보
[출처] [펌:MSDN] _WIN32_WINNT define|작성자 판타Minimum system required Macros to define Windows Server 2003 family _WIN32_WINNT>=0x0502 Windows XP _WIN32_WINNT>=0x0501 Windows 2000 _WIN32_WINNT>=0x0500 Windows NT 4.0 _WIN32_WINNT>=0x0400 Windows Me _WIN32_WINDOWS=0x0490 Windows 98 _WIN32_WINDOWS>=0x0410 Internet Explorer 6.0 _WIN32_IE>=0x0600 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
Minimum system required | Minimum value for _WIN32_WINNT and WINVER |
---|---|
Windows 7 | _WIN32_WINNT_WIN7 (0x0601) |
Windows Server 2008 | _WIN32_WINNT_WS08 (0x0600) |
Windows Vista | _WIN32_WINNT_VISTA (0x0600) |
Windows Server 2003 with SP1, Windows XP with SP2 | _WIN32_WINNT_WS03 (0x0502) |
Windows Server 2003, Windows XP | _WIN32_WINNT_WINXP (0x0501) |
Minimum version required | Minimum value of _WIN32_IE |
---|---|
Internet Explorer 8.0 | _WIN32_IE_IE80 (0x0800) |
Internet Explorer 7.0 | _WIN32_IE_IE70 (0x0700) |
Internet Explorer 6.0 SP2 | _WIN32_IE_IE60SP2 (0x0603) |
Internet Explorer 6.0 SP1 | _WIN32_IE_IE60SP1 (0x0601) |
Internet Explorer 6.0 | _WIN32_IE_IE60 (0x0600) |
Internet Explorer 5.5 | _WIN32_IE_IE55 (0x0550) |
Internet Explorer 5.01 | _WIN32_IE_IE501 (0x0501) |
Internet Explorer 5.0, 5.0a, 5.0b | _WIN32_IE_IE50 (0x0500) |
'프로그래밍' 카테고리의 다른 글
VS2010 lib 사용 설정 (0) | 2012.12.03 |
---|---|
Windows Sockets Error Codes (Windows) (0) | 2012.11.18 |
A reusable, high performance, socket server class (0) | 2012.08.16 |
[펌] 소켓 프로그래밍에 관한 주의 및 Q&A (0) | 2012.08.16 |
[펌] ACE 강의(2) (0) | 2012.08.13 |