Article View: comp.os.ms-windows.programmer.misc
Article #2523Re: Use of STRICT def. in windows.h
From: Dave Jones
Date: Wed, 06 Jan 1993 19:05
Date: Wed, 06 Jan 1993 19:05
28 lines
1583 bytes
1583 bytes
Sarir Khamsi (khamsi@ll.mit.edu) wrote:
> Yo,
>
> Does anyone know where I can find information on what the meaning of
> the
>
> #ifdef STRICT
>
> statements in the windows.h file is? Does this have anything to do w/
> NT, backward compatibility or what? Thanks in advance.
>
Its a way of forcing type checking in types that are different in name but
not in fact. For instance a HPALETTE is a HANDLE which is a WORD.
Therefore you can pass a HPALETTE to a WORD parameter, or any other
compatible pseudo-type (pseudo- because the normal definition of HPALETTE
is just via #define HPALETTE HANDLE or some such).
When STRICT is in force the type definitions are carefully crafted to
generate compiler errors if you use the names in the wrong places. This
is done usually by something like:
#define HPALETTE struct tagHP {uint unused}
Look in any of the .h files for examples like this.
--
||------------------------------------------------------------------------
||Dave Jones (dj@ekcolor.ssd.kodak.com)|Eastman Kodak Co. Rochester, NY |
Technical Details
Message-ID:
<1993Jan6.190526.22736@pixel.kodak.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!ekcolor!djReferences:
<9301061117.PN20611@LL.MIT.EDU>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!ekcolor!dj From: dj@ekcolor.ssd.kodak.com (Dave Jones) Subject: Re: Use of STRICT def. in windows.h Message-ID: <1993Jan6.190526.22736@pixel.kodak.com> Sender: news@pixel.kodak.com Organization: Vonnegut Tent Rentals, Inc. X-Newsreader: TIN [version 1.1 PL7] References: <9301061117.PN20611@LL.MIT.EDU> Distribution: comp Date: Wed, 6 Jan 93 19:05:26 GMT Lines: 29