home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!spool.mu.edu!torn!nott!emr1!jagrant
- From: jagrant@emr1.emr.ca (John Grant)
- Subject: Re: Use of STRICT def. in windows.h
- Message-ID: <1993Jan6.221607.28940@emr1.emr.ca>
- Organization: Energy, Mines, and Resources, Ottawa
- References: <9301061117.PN20611@LL.MIT.EDU>
- Distribution: comp
- Date: Wed, 6 Jan 1993 22:16:07 GMT
- Lines: 32
-
- In article <9301061117.PN20611@LL.MIT.EDU> khamsi@ll.mit.edu (Sarir Khamsi) writes:
- >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.
-
- Look at what it is doing in the windows.h file. You can
- see it all there.
-
- Basically, without STRICT, all of those HWND, HCURSOR, HPEN,
- etc handles are just UINTs, so the compiler can't detect
- an error like:
- PAINTSTRUCT ps;
- HDC hdc;
- HWND hwnd;
- hwnd=BeginPaint(hdc,&ps);
- when you actually wanted to do:
- hdc=BeginPaint(hwnd,&ps);
-
- With STRICT, each handle type is defined as a pointer to a
- dummy struct (a different one is defined for each type of
- handle). Now the compiler can check all arguments which
- now appear as pointers to specific structs.
- --
- John A. Grant jagrant@emr1.emr.ca
- Airborne Geophysics
- Geological Survey of Canada, Ottawa
-