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

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!newsserver.pixel.kodak.com!ekcolor!dj
  3. From: dj@ekcolor.ssd.kodak.com (Dave Jones)
  4. Subject: Re: Use of STRICT def. in windows.h
  5. Message-ID: <1993Jan6.190526.22736@pixel.kodak.com>
  6. Sender: news@pixel.kodak.com
  7. Organization: Vonnegut Tent Rentals, Inc.
  8. X-Newsreader: TIN [version 1.1 PL7]
  9. References: <9301061117.PN20611@LL.MIT.EDU>
  10. Distribution: comp
  11. Date: Wed, 6 Jan 93 19:05:26 GMT
  12. Lines: 29
  13.  
  14. Sarir Khamsi (khamsi@ll.mit.edu) wrote:
  15. > Yo,
  16. > Does anyone know where I can find information on what the meaning of
  17. > the
  18. > #ifdef STRICT
  19. > statements in the windows.h file is? Does this have anything to do w/
  20. > NT, backward compatibility or what? Thanks in advance.
  21. Its a way of forcing type checking in types that are different in name but
  22. not in fact.  For instance a HPALETTE is a HANDLE which is a WORD.  
  23. Therefore you can pass a HPALETTE to a WORD parameter, or any other 
  24. compatible pseudo-type (pseudo- because the normal definition of HPALETTE
  25. is just via #define HPALETTE HANDLE or some such).
  26.  
  27. When STRICT is in force the type definitions are carefully crafted to
  28. generate compiler errors if you use the names in the wrong places.  This
  29. is done usually by something like: 
  30.  
  31. #define HPALETTE struct tagHP {uint unused}
  32.  
  33. Look in any of the .h files for examples like this.
  34.  
  35. -- 
  36. ||------------------------------------------------------------------------ 
  37. ||Dave Jones (dj@ekcolor.ssd.kodak.com)|Eastman Kodak Co.  Rochester, NY | 
  38.  
  39.