CModalDialog::CreateIndirect

Syntax

BOOL CreateIndirect( HANDLE hDialogTemplate );

Parameters

hDialogTemplate

Contains a resource handle to global memory containing a dialog-box resource template. The template data structure is of type DLGTEMPLATE, which identifies the block of memory used as a dialog-box template.

Remarks

This member function uses a dialog resource constructed in memory to initialize a modal dialog object. The resource has the form of a DLGTEMPLATE structure. For more information on this structure, see the Windows Software Development Kit documentation.

To create a modal dialog indirectly, first create a DLGTEMPLATE structure in memory and retain a HANDLE to it. Then call the CModalDialog constructor to construct the dialog object. In this case, pass NULL for the first parameter to the constructor. Next, call CreateIndirect to store your handle to the in-memory dialog template. The Windows dialog is created and displayed later, when the DoModal member function runs.

Return Value

TRUE if the dialog object was created and initialized successfully; otherwise FALSE.

See Also

WM_INITDIALOG, DS_SETFONT, DLGTEMPLATE, CWnd::DestroyWindow, CModalDialog::CModalDialog