Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CDialogImpl Class
Collapse the table of content
Expand the table of content

CDialogImpl Class

This class provides methods for creating a modal or modeless dialog box.

Important note Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

template < 
class T, 
class TBase= CWindow  
class ATL_NO_VTABLE CDialogImpl : 
public CDialogImplBaseT< TBase>


Your class, derived from CDialogImpl.


The base class of your new class. The default base class is CWindow.


Creates a modeless dialog box.


Destroys a modeless dialog box.


Creates a modal dialog box.


Destroys a modal dialog box.


Returns the current dialog box procedure.


Maps the dialog-box units of the specified rectangle to screen units (pixels).


Called after receiving the last message, typically WM_NCDESTROY.


Processes messages sent to the dialog box.


Called when the first message is received to process messages sent to the dialog box.

With CDialogImpl you can create a modal or modeless dialog box. CDialogImpl provides the dialog box procedure, which uses the default message map to direct messages to the appropriate handlers.

The base class destructor ~CWindowImplRoot ensures that the window is gone before destroying the object.

CDialogImpl derives from CDialogImplBaseT, which in turn derives from CWindowImplRoot.

Note Note

Your class must define an IDD member that specifies the dialog template resource ID. For example, the ATL Project Wizard automatically adds the following line to your class:

enum { IDD = IDD_MYDLG };

where MyDlg is the Short name entered in the wizard's Names page.

For more information about


Creating controls

ATL Tutorial

Using dialog boxes in ATL

ATL Window Classes

ATL Project Wizard

Creating an ATL Project

Dialog boxes

Dialog Boxes and subsequent topics in the Windows SDK

Header: atlwin.h

© 2015 Microsoft