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

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. From: chris@chrism.demon.co.uk (Chris Marriott)
  3. Path: sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
  4. Subject: Re: Data Type problem !! 
  5. Distribution: world
  6. References: <1993Jan9.085030.11967%gtonwu@Uz.nthu.edu.tw>
  7. Organization: None
  8. Reply-To: chris@chrism.demon.co.uk
  9. X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
  10. Lines: 52
  11. Date: Sat, 9 Jan 1993 17:42:02 +0000
  12. Message-ID: <726601322snz@chrism.demon.co.uk>
  13. Sender: usenet@demon.co.uk
  14.  
  15. In article <1993Jan9.085030.11967%gtonwu@Uz.nthu.edu.tw> gtonwu@Uz.nthu.edu.tw writes:
  16.  
  17. >Hi, there 
  18. >
  19. >     I am confused by type data types of MSC ! I don't know what is the
  20. >     difference among them , since I was simply using int,unsigned,char..
  21. >     while I did programming under MS-DOS before    !
  22. >
  23. >     Would someone kind enough to tell me the distict difference of the 
  24. >     following !?
  25. >
  26. >       WORD , DWORD, LONG, WPARAM, LPARAM , ... 
  27. >
  28. >       and some others I have to know !
  29. >
  30.  
  31. Basically, the reason these new types are there is so you can write source
  32. code which is portable between 16 and 32-bit versions of Windows.  Eg, an
  33. "int" is 16 bits in Windows 3.1, but 32 bits in Windows NT.  A "WORD", on the
  34. other hand, is *always* 16 bits and so is portable.
  35.  
  36. Basically,
  37.  
  38.     WORD = unsigned int
  39.     DWORD = unsigned long
  40.     LONG = long
  41.  
  42. but there's really no need to *know* that.  Just declare your own variables
  43. using the appropriate types and you'll be OK.  If you really *must* know,
  44. the new types are all defined in "windows.h".
  45.  
  46. The best way to make sure you're using all the new types correctly is to
  47. #define STRICT and then get rid of all the warning messages you'll most
  48. likely get.
  49.  
  50. >
  51. >-- 
  52. >+--------------------------------------------------------------------------+ 
  53. >| Tony Wu.   (: gtonwu@uz.nthu.edu.tw :)  National Tsing Hua Univ. CHE 95. |
  54. >|                                                                          |
  55. >|    @@#  Hey," You can't beat the feeling !". #@@                         |
  56. >
  57.  
  58. Chris
  59. -- 
  60. --------------------------------------------------------------------------
  61. | Chris Marriott                           | chris@chrism.demon.co.uk    |
  62. | Warrington, UK                           | BIX: cmarriott              |
  63. | (Still awaiting inspiration              | CIX: cmarriott              |
  64. |  for a witty .sig .... )                 | CompuServe: 100113,1140     |
  65. --------------------------------------------------------------------------
  66.  
  67.