Re: DoModal()
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Mon, 12 Jan 2009 13:04:20 -0500
Note, however, that if anyone calls CDialog::OnOK(), they will call YOUR OnOK handler,
because it is a virtual method. Your OnOK() handler then calls CDialog::OnOK, which is
shown below. But if you call EndDialog(IDOK), then your OnOK() handler is NOT called, and
key behavior (such as the call on UpdateData(TRUE)) will not be executed. Therefore, it
should generally be considered inappropriate for YOUR dialog to call EndDialog(IDOK).
joe
On Mon, 12 Jan 2009 12:07:11 -0500, David Wilkinson <no-reply@xxxxxxxxxxxx> wrote:
hamishd wrote:Joseph M. Newcomer [MVP]
What is the difference between this->EndDialog(IDOK); and CDialog::OnOK
(); ?
hamishd:
Go to the source:
void CDialog::OnOK()
{
if (!UpdateData(TRUE))
{
TRACE(traceAppMsg, 0, "UpdateData failed during dialog termination.\n");
// the UpdateData routine will set focus to correct item
return;
}
EndDialog(IDOK);
}
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: DoModal()
- From: David Wilkinson
- Re: DoModal()
- References:
- DoModal()
- From: hamishd
- Re: DoModal()
- From: David Ching
- Re: DoModal()
- From: hamishd
- Re: DoModal()
- From: Joseph M . Newcomer
- Re: DoModal()
- From: hamishd
- Re: DoModal()
- From: David Wilkinson
- DoModal()
- Prev by Date: Re: dynamic_cast does not work as specified
- Next by Date: Re: Font for a menu?
- Previous by thread: Re: DoModal()
- Next by thread: Re: DoModal()
- Index(es):
Relevant Pages
|