Original Post
I send different messages (structs) to a message handler.
#define WM_NAME_1 1001
#define WM_NAME_2 1002
struct msg_Kind_1
{
DWORD msg_id; //message identifier
char Name[24];
};
I give every message struct to send a message identifier.
msg_Kind_1 msg_1;
msg_1.msg_id = WM_NAME_1;
In the message handler I get the message identifier by the following macro.
#define GET_MSGID(p)(*((DWORD *)(p)))
In the message handler I save the received message in "rd" ...
PBYTE rd = ( (DPNMSG_RECEIVE *) pMessage)->pReceiveData;
... and try to get the message identifier.
switch(GET_MSGID (rd))
{
case WM_NAME_1:
...
...
How can I contol if the a message I get in the message handler also is a struct that has a message identifier? If have to control it before calling the makro "GET_MSGID", because my application crashs here and it seems that my message handler get other messages without a message identifier I defined.
Thanks for reply in advance.