Share via


CDialog::InitModalIndirect

BOOL InitModalIndirect( LPCDLGTEMPLATE lpDialogTemplate**, CWnd*** pParentWnd = NULL );

BOOL InitModalIndirect( HGLOBAL hDialogTemplate**, CWnd*** pParentWnd = NULL );

Return Value

Nonzero if the dialog object was created and initialized successfully; otherwise 0.

Parameters

lpDialogTemplate

Points to memory that contains a dialog-box template used to create the dialog box. This template is in the form of a structure and control information. For more information on this structure, see the Win32 SDK documentation.

hDialogTemplate

Contains a handle to global memory containing a dialog-box template. This template is in the form of a DLGTEMPLATE structure and data for each control in the dialog box.

pParentWnd

Points to the parent or owner window object (of type CWnd) to which the dialog object belongs. If it is NULL, the dialog object’s parent window is set to the main application window.

Remarks

Call this member function to initialize a modal dialog object using a dialog-box template that you construct in memory.

To create a modal dialog box indirectly, first allocate a global block of memory and fill it with the dialog box template. Then call the empty CDialog constructor to construct the dialog-box object. Next, call InitModalIndirect to store your handle to the in-memory dialog-box template. The Windows dialog box is created and displayed later, when the DoModal member function is called.

CDialog OverviewClass MembersHierarchy Chart

See Also   , CDialog::DoModal, CWnd::DestroyWindow, CDialog::CDialog