SendMessage causes an exception in release.
FYI I use VC++ 6 STD and program in MFC.
I created a Dialog program with AppWizard. Then using ClassWizard a created a class called DSocket derived from CAsyncSocket. In DSocket's header file I defined DSOCK_RECEIVE as WM_APP + 1. Then in I also added a member variable called m_hWnd and the dialog sets it to the dialogs window. In DSocket's vitual function OnRecieve I call SendMessage(m_hWnd,DSOCK_RECIEVE,0,0). Then in my Dialog cpp file I added ON_MESSAGE(DSOCK_RECEIVE,OnSocketReceive) to my message map. However, this causes an exception in Release but not in Debug. It is the SendMessage() that fails for if I comment in out alone there's no exception. I could used alternative methods to do this but I would have to set a timer in my dialog and keep checking but that's not efficient. Any ideas why this fails?