Click to See Complete Forum and Search --> : Post Message


June 17th, 1999, 12:17 PM
A CDialog class displays (a report) in a CFrameView window.
I am trying to display a messagebox when the user closes the FrameView, by posting a message to the dialog


pwnd->PostMessage(WM_U_CLOSE_REPORT); // user defined message




and trapping the message in the dialog (and then showing the messagebox)


BEGIN_MESSAGE_MAP(CRptSiCheckRegister, CToolDlg)
//{{AFX_MSG_MAP(CRptSiCheckRegister)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_U_CLOSE_REPORT, OnCloseReport)
END_MESSAGE_MAP()




This is supposed to stop the messgebox from displaying over the top of the FrameView.
I need the Dialog to produce the messagebox and NOT the FrameView.

The above WORKS perfectly in DEBUG mode, but throws a MFC42.DLL exception at run time in RELEASE mode.

Any ideas on either the fix - or a workaround.

Thanks,
Ian
ian@hockadayangle.com

June 17th, 1999, 12:58 PM
Check out article Q195032 about Incorrect Function Signatures.

June 17th, 1999, 03:09 PM
Don't forget that all Message handler functions need to have a WParam and LParam as parameters!