Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packaging values in DWORD

How would I package two unsigned short (WORD) values into one unsigned long (DWORD) value?

I know how to get them using HIWORD and LOWORD macros but is there a ... sort of reverse macro for storing them into a DWORD quickly?

I'm programming in C++ with Microsoft Visual Studio 2012 IDE.

like image 615
l3utterfly Avatar asked May 07 '26 08:05

l3utterfly


1 Answers

MAKELONG takes two WORDs and combines them into a single DWORD:

DWORD MAKELONG(
  WORD wLow,
  WORD wHigh
);

No idea why it isn't called MAKEDWORD...

like image 169
NPE Avatar answered May 09 '26 22:05

NPE