I coded a programm which uses MFC and therefore WinAPI-functions like PostMessage. It's mainly just one Window-thread and a network-client-thread.
I created my own Message and it works fine so far.
To explain the program a bit:
I wrote a Client which gets messages over the network, decodes them and then needs to send Messages to the Window which shows the Values of the Messages. All this works - with 32 bit values. It surely is some kind of not correctly using the PostMessage-function, because lParam and wParam are Pointers normally. But I can't use just Pointers because my client-application and my Window application are two different threads and the values in the client application get deleted as soon as possible. (The client needs to call a cyclic request from the server)
#define DEVICE_INFO_DATETIME 70000
long long date;
date = (value->serverTimestamp);
PostMessage(getWindowHandle(), WM_NEW_DATA, date, DEVICE_INFO_DATETIME);
Thing is I get timestamps and other data encoded as 64 bit. And wparam and lparam are just 32 bit, so it always truncates my values. Ok I can compile it in 64 bit, then 64-bit values are used but this is not compatible to 32 bit systems (right?) and not what I want. A workaround for this kind of code is setting up an temporary 64 bit value or maybe an array of 64 bit values as a global variable but I don't want to save them all in a seperate value regarding the memory. Just passing the value would be the best solution here.
Do you have any guesses what I could do here?