Creating and Displaying Dialog Boxes

Creating a dialog object is a two-phase operation. First, construct the dialog object, then create the dialog window. Modal and modeless dialog boxes differ somewhat in the process used to create and display them. The following table lists how modal and modeless dialog boxes are normally constructed and displayed.

Dialog Creation

Dialog type How to create it
Modeless Construct CDialog, then call Create member function.
Modal Construct CDialog, then call DoModal member function.

You can, if you want, create your dialog box from an in-memory dialog template that you have constructed rather than from a dialog template resource. This is an advanced topic, however.

See also

Working with Dialog Boxes in MFC