newstandard
asked on
cant get dialog to return a value
i cant get my dialog to close and return a value. What method do i use to force the dialog to close? here is the code in my parent class. if i close the dialog using OnOK() no message box is displayed in the code below.
mainDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
AfxMessageBox("ok");
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
AfxMessageBox("cancel");
}
else AfxMessageBox("crap");
mainDlg dlg;
m_pMainWnd = &dlg;
INT_PTR nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
AfxMessageBox("ok");
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
AfxMessageBox("cancel");
}
else AfxMessageBox("crap");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
lol, thanks :o)
Nice of you, but I feel, I shouldn't get points here. Want me to ask for "undoing" in CS ?
Nice of you, but I feel, I shouldn't get points here. Want me to ask for "undoing" in CS ?
ASKER
don't worry about it. take the points. they mean nothing anyways. :-)
ASKER
m_pMainWnd = &dlg;
does this have any ramifications?