المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : User defined message , exeption at the handler return [modified]



C++ Programming
12-11-2010, 10:13 AM
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:
.
.
afx_msg LRESULT OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam);
.
.

Parent dialog header, Declared Mesagge map:
.
.
afx_msg void OnMsjGuardarConfig();
.
.

Parent dialog source, file Message map:
.
.
ON_MESSAGE(WM_MsjGuardarConfig, OnMsjGuardarConfig)
.
.

Parent dialog source, file definition of the handler:

LRESULT CCalibracionDlg::OnMsjGuardarConfig(WPARAM wParam, LPARAM lParam)
{
//i do some stuffs
return 0; // ==> here is exception !!!!
}
Defining the user defined message in StdAfx.h:
.
.
#define WM_MsjGuardarConfig WM_USER+1 //
.
.

Posting the message in the child dialog:
void CConfiguracionDlg::OnBUTTONGuadar()
{
GetParent()->;PostMessage(WM_MsjGuardarConfig,NULL,NULL); //}

Probably is some newbie problem , but i can't fix it until now.http://www.barakasoft.com/script/Forums/Images/smiley_frown.gif
Thanks in advance!!
modified on Friday, December 10, 2010 10:25 AM