CModalDialog::DoModal

Syntax

int DoModal();

Remarks

Invokes the dialog box and returns the dialog box result when done. This member function handles all interaction with the user while the dialog box is active. This is what makes the dialog box modal; that is, the user cannot interact with other windows until the dialog box is closed.

If the user clicks one of the push buttons in the dialog box, such as OK or Cancel, a message-handler member function, such as OnOK or OnCancel, is called to attempt to close the dialog box. The default OnOK and OnCancel member functions will end the dialog with results IDOK and IDCANCEL, respectively. You can override these message-handler functions to alter this behavior.

Return Value

An int value that specifies the value of the nResult parameter that was passed to the EndDialog member function, which is used to terminate the dialog box.The return value is -1 if the function could not create the dialog box.

See Also

::DialogBox