🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2650

Re: Data Type problem !!

#2650
From: Chris Marriott
Date: Sat, 09 Jan 1993 17:42
52 lines
2545 bytes
In article <1993Jan9.085030.11967%gtonwu@Uz.nthu.edu.tw> gtonwu@Uz.nthu.edu.tw writes:

>Hi, there 
>
>     I am confused by type data types of MSC ! I don't know what is the
>     difference among them , since I was simply using int,unsigned,char..
>     while I did programming under MS-DOS before    !
>
>     Would someone kind enough to tell me the distict difference of the 
>     following !?
>
>       WORD , DWORD, LONG, WPARAM, LPARAM , ... 
>
>       and some others I have to know !
>

Basically, the reason these new types are there is so you can write source
code which is portable between 16 and 32-bit versions of Windows.  Eg, an
"int" is 16 bits in Windows 3.1, but 32 bits in Windows NT.  A "WORD", on the
other hand, is *always* 16 bits and so is portable.

Basically,

    WORD = unsigned int
    DWORD = unsigned long
    LONG = long

but there's really no need to *know* that.  Just declare your own variables
using the appropriate types and you'll be OK.  If you really *must* know,
the new types are all defined in "windows.h".

The best way to make sure you're using all the new types correctly is to
#define STRICT and then get rid of all the warning messages you'll most
likely get.

>
>-- 
>+--------------------------------------------------------------------------+ 
>| Tony Wu.   (: gtonwu@uz.nthu.edu.tw :)  National Tsing Hua Univ. CHE 95. |
>|                                                                          |
>|    @@#  Hey," You can't beat the feeling !". #@@                         |
>

Chris
-- 
--------------------------------------------------------------------------
| Chris Marriott                           | chris@chrism.demon.co.uk    |
| Warrington, UK                           | BIX: cmarriott              |
| (Still awaiting inspiration              | CIX: cmarriott              |
|  for a witty .sig .... )                 | CompuServe: 100113,1140     |
--------------------------------------------------------------------------
 
Technical Details
Message-ID: <726601322snz@chrism.demon.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
References: <1993Jan9.085030.11967%gtonwu@Uz.nthu.edu.tw>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
From: chris@chrism.demon.co.uk (Chris Marriott)
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!demon!chrism.demon.co.uk!chris
Subject: Re: Data Type problem !! 
Distribution: world
References: <1993Jan9.085030.11967%gtonwu@Uz.nthu.edu.tw>
Organization: None
Reply-To: chris@chrism.demon.co.uk
X-Mailer: Simple NEWS 1.90 (ka9q DIS 1.19)
Lines: 52
Date: Sat, 9 Jan 1993 17:42:02 +0000
Message-ID: <726601322snz@chrism.demon.co.uk>
Sender: usenet@demon.co.uk