Jump to content
  • Advertisement
Sign in to follow this  
Uphoreum

Windows Data Type Macros

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there any reason to use the macros instead of the actual data type names? For example: DWORD or ULONG instead of unsigned long? Do the values of these macros change if you move to a 64-bit system or something? Or are they simply just for being shorter (if that was the case, why would the FLOAT and INT macros exist?)

Share this post


Link to post
Share on other sites
Advertisement
Some types will not change between 32-bit and 64-bit, for example, DWORD and ULONG. In fact, these types are pretty much guaranteed to never change. Types based on pointers, such as WPARAM, LPARAM, LP*, P*, or *_PTR will change in size from 32-bit to 64-bits.

That said, I prefer to use the Win32 type macros for visual consistency with the other types. Types like DWORD_PTR become much easier to understand if you're also using DWORDs.

Share this post


Link to post
Share on other sites
I found this page which seems to explain it pretty well. Basically, it looks like BYTE, WORD, DWORD, and QWORD are architecture independent while LONG, CHAR, etc. are not.

Thanks, I was also wondering if people use it for the visual consistency, so that answers that question too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!