DWORD is not a standard C datatype. Typically it represents a double word. On a 16-bit machine a WORD would be 16 bits, on a 32-bit machine, it would be 32 bits.
Having said that, it would imply that a double word on a 16 bit machine is 32 bits and on a 32 bit machine, it would be 64 bits. However, that is very vendor dependent. If you use the 32-bit Microsoft compilers, a WORD and DWORD are the same size!!!
Since it deals with words, it is meant for low level use for instance bit patterns on an IO chip. If you want high level usage, use unsigned long.
i'm using vista and it says dword is a 32 bit value and qword is a 64 bit. i've not used the registry before but it looks like dword is where i would store any numeric values, is that right? i can't see any other suitable types.
xwb, can you prove this "If you use the 32-bit Microsoft compilers, a WORD and DWORD are the same size!!!" ? as far as I've checked, WORD is always unsigned short, which is 16bit, and never 32bit..
cpjust - you just proved him wrong. And I asked him to prove himself right. short is 16bits.. at least on Microsoft platforms.. be it 16bit, 32bit or 64bit platforms or compilers.
Some addition (don't forget): C (and C++) standards define int range via the natural size suggested by the architecture of the execution environment (but at least 16 bit). Moreover, long and short int types may be equal to the plain int.
The DWORD type (alias) is defined as a member of Windows Data Types set:
I think, the right answer is (a sort of:
DWORD is MS Windows environment implementation defined integer type alias used in Windows API context only (and nowhere else.
Apologies - I got confused between WORD and WPARAM. WPARAM and LPARAM which are used in the SendMessage call are both 32 bits. WPARAM used to be 16 bits on win3.x.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.