|
From: Yeoh H. <ye...@ye...> - 2002-12-11 08:48:41
|
Hi,
#if and #endif are compiler directives. This means that the compiler can
conditionally compile certain sections of code.
#if (_WIN32_IE >=3D 0x0300)
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX;
#endif
What happens?
If _WIN32_IE is defined to be >=3D 0x0300 then compile the code within th=
e #if
and #endif block.
If _WIN32_IE is not defined, then the code within the #if and #endif bloc=
k
would not be included for compilation.
What is this _WIN32_IE >=3D 0x0300?
This means that if Windows 32 bit Internet Explorer version 3.0 or later =
is
installed, then the code within the #if and #end if is compiled.
Why this _WIN32_IE >=3D 0x0300? To explain why, you'll need more informat=
ion
from MSDN.
Here're some details about Common Controls from MSDN
<begin extract>
Because of ongoing enhancements, different versions of Comctl32.dll
implement different features. Throughout this document, programming eleme=
nts
are marked with a version number. This version number indicates that the
programming element is implemented in that version and later versions of
Comctl32.dll. If no version number is specified, the programming element =
is
implemented in all versions. The following table outlines the different
versions of Comctl32.dll and the distribution platform.
Version Distribution platform
4.00 Microsoft=AE Windows=AE 95/Windows NT=AE 4.0
4.70 Microsoft=AE Internet Explorer 3.x
4.71 Microsoft=AE Internet Explorer 4.0
4.72 Microsoft=AE Internet Explorer 4.01
To ensure that your application is compatible with different targeted
versions of the common control DLL (Comctl32.dll), a version macro was ad=
ded
to Commctrl.h. This version macro is used to define, exclude, or redefine
certain common control definitions for different versions of the DLL. The
macro name is _WIN32_IE and you, the developer, are responsible for defin=
ing
the macro as a hexadecimal number. This version number defines the target
version of the application that is using the DLL.
<end extract>
For details, please look up MSDN. It also has code to get the commctrl dl=
l
version.
Regards,
Yeoh
--
http://www.yeohhs.com
You wrote:
> OK. Thanks. But can you explain what that directive does? I don't like
using
> something I don't understand.
>
|