I'm making a network chat program using MFC in VC++ 6. I derived a class from CAsyncSocket. At the top of this class's header file I added:
#define DSOCK_RECEIVE WM_APP
#define DSOCK_CONNECTED WM_APP+1
It has a pointer (HWND* m_hWndParent) to the HWND of the dialog class it's a member of. In some of it's functions it calls this:
SendMessage(*m_hWndParent, DSOCK_RECEIVE, 0, 0);
In the dialogs message map it has:
At runtime in the Debug build of this application all goes smooth, at runtime in the Release build it says "Chat has caused an error in MFC42.DLL." I tried commenting out only the part where it sends the mesage and it ran fine. I cannot think of any other way to "get the message across" to my dialog. And I don't know why this fails. Any suggestions? ANSWERS?
Thanks in advance.