OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Executing common dialog boxes

After you have constructed the common dialog box object, you either execute it (for a modal dialog box) or create it (for a modeless dialog box).

The following table lists whether each type of common dialog box must be modal or modeless.

TypeModal or modelessRun by calling
ColorModalExecute
FontModalExecute
File openModalExecute
File saveModalExecute
FindModelessCreate
Find/replaceModelessCreate
PrinterModalExecute

You must check Execute's return value to see whether the user chose OK or Cancel, or to determine if an error occurred. For example,

TChooseColorDialog::TData colors;
TChooseColorDialog colorDlg(this, colors);
if (colorDlg.Execute() == IDOK)
// OK: data.Color == the color the user
// Some code here
else if (data.Error)
// error occurred!
// Some code here
MessageBox("Error in color dialog box!", GetApplication()->Name, MB_OK | MB_ICONSTOP);

See Also