Hello, Im using a dialog based app (VC++ 6), with a main dialog and his child dialog (modals dialogs).
And i have to use a user defined message to send a message to the parent dialog. When i'm debugging, in the handler of this message (in the parent dialog) i get this exception in the return sentence "Unhandled exception in Myapp.exe (MFC42D.DLL):0xc0000005: Acces Violation
Parent dialog header, declaration of Handler:
Parent dialog header, Declared Mesagge map:Code:. . afx_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam); . .
Parent dialog source, file Message map:Code:. . afx_msg void OnMsjGuardarConfig(); . .
Parent dialog source, file definition of the handler:Code:. . ON_MESSAGE(WM_MsjGuardarConfig, OnMsjGuardarConfig) . .
Defining the user defined message in StdAfx.h:Code:LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam) { //i do some stuffs return 0; // ==> here is exception !!!! }
Posting the message in the child dialog:Code:. . #define WM_MsjGuardarConfig WM_USER+1 // . .
Probably is some newbie problem , but i can't fix it until now.Code:void CConfiguracionDlg::OnBUTTONGuadar() { GetParent()->;PostMessage(WM_MsjGuardarConfig,NULL,NULL); // }![]()
Thanks in advance!!




Reply With Quote
