, .
, , , Win32, Win32 ID, , ( , ). , nResult, EndDialog, .
. (, , , , -1 , ).
- , . IDOK. ( ) - IDCANCEL. OnButtonClick , IDOK IDCANCEL. IDCANCEL, -, , .
, . , , (, m_errStatus - -, CDialog):
void MyClass::OnButtonClick()
{
if (SomeDialog.DoModal() == IDOK)
{
MessageBox("All is well"...blah ...blah);
}
else
{
switch (SomeDialog.m_errStatus)
{
case MYCLASS_ERROR_1:
MessageBox("Error 1 occurred.");
break;
case MYCLASS_ERROR_2:
MessageBox("Error 2 occurred.");
break;
}
}
}