Windows Version Build Option

[Previous] [Next]

Because some of the sample applications call functions that are new in Microsoft Windows 2000, this section of CmnHdr.h defines the _WIN32_WINNT symbol as follows:

 #define _WIN32_WINNT 0x0500 

I have to define this symbol because the new Windows 2000 functions are prototyped in the Windows header files like this:

 #if (_WIN32_WINNT >= 0x0500) WINBASEAPI BOOL WINAPI AssignProcessToJobObject(    IN HANDLE hJob,    IN HANDLE hProcess    ); #endif /* _WIN32_WINNT >= 0x0500 */ 

Unless you specifically define _WIN32_WINNT as I have (before including Windows.h), the prototypes for the new functions will not be declared, and the compiler will generate errors when you attempt to call these functions. Microsoft has protected these functions with the _WIN32_WINNT symbol to help ensure that applications you develop can run on multiple versions of Microsoft Windows NT and Microsoft Windows 98.



Programming Server-Side Applications for Microsoft Windows 2000
Programming Server-Side Applications for Microsoft Windows 2000 (Microsoft Programming)
ISBN: 0735607532
EAN: 2147483647
Year: 2000
Pages: 126

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net