home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4659 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.3 KB  |  44 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!spool.mu.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Use of STRICT def. in windows.h
  5. Message-ID: <1993Jan6.221607.28940@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <9301061117.PN20611@LL.MIT.EDU>
  8. Distribution: comp
  9. Date: Wed, 6 Jan 1993 22:16:07 GMT
  10. Lines: 32
  11.  
  12. In article <9301061117.PN20611@LL.MIT.EDU> khamsi@ll.mit.edu (Sarir Khamsi) writes:
  13. >Yo,
  14. >
  15. >Does anyone know where I can find information on what the meaning of
  16. >the
  17. >
  18. >#ifdef STRICT
  19. >
  20. >statements in the windows.h file is? Does this have anything to do w/
  21. >NT, backward compatibility or what? Thanks in advance.
  22.  
  23.     Look at what it is doing in the windows.h file.  You can
  24.     see it all there.
  25.  
  26.     Basically, without STRICT, all of those HWND, HCURSOR, HPEN,
  27.     etc handles are just UINTs, so the compiler can't detect
  28.     an error like:
  29.         PAINTSTRUCT ps;
  30.         HDC hdc;
  31.         HWND hwnd;
  32.         hwnd=BeginPaint(hdc,&ps);
  33.     when you actually wanted to do:
  34.         hdc=BeginPaint(hwnd,&ps);
  35.  
  36.     With STRICT, each handle type is defined as a pointer to a
  37.     dummy struct (a different one is defined for each type of
  38.     handle).  Now the compiler can check all arguments which
  39.     now appear as pointers to specific structs.
  40. -- 
  41. John A. Grant                        jagrant@emr1.emr.ca
  42. Airborne Geophysics
  43. Geological Survey of Canada, Ottawa
  44.