I need to pack this
pointer (which is 64 bits wide) into 4 WORD
's, and then later in some other part of the code I need to extract (assemble) these words back into this
pointer.
the code looks like this:
std::vector<WORD> vec;
vec.push_back( this ); // how?
later in the code;
pThis = vec.at(0); // how?
I did take a look at LOWORD/HIWORD
and LOWBYTE/HIBYTE
macros however I still have no idea how would I go about this.
If you ask why on earth would anyone need this, here is why:
I need to fill in creation data of DLGITEMTEMPLATEEX structure which takes WORD
as last argument to specify size, data following this is where you put your data, my data is this
pointer, and since I'm working on words (std::vector<WORD>
) to fill the structure, the last data is 4 WORDS (64 bits) representing the pointer!
Any suggestion or sample code is welcome.