Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CDialog::CreateIndirect
CDialog                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  Protected: BOOL CreateIndirect( const BYTE FAR* lpDialogTemplate,
                                  CWnd* pParentWnd = NULL);
 
  Parameter          Description
 
  <lpDialogTemplate> Points to a global memory object that contains a
                     dialog-box template used to create the dialog box. An
                     application must build the dialog-box template
                     according to the guidelines outlined in the
                     description of the application-defined DLGTEMPLATE
                     data structure.
 
  <pParentWnd>       Points to the dialog object's parent window object
                     (of type CWnd). If it is NULL, the dialog object's
                     parent window is set to the main application window,
                     as shown in the following code:
 
                     if( pParentWnd == NULL )
                         pParentWnd = AfxGetApp()->m_pMainWnd;
 
  Remarks
 
  Creates a modeless dialog box from a dialog-box template in memory.
  CreateIndirect is protected.
 
  Before the dialog box is displayed, Windows sends the WM_INITDIALOG
  message to the dialog box. If the dialog box has the DS_SETFONT style,
  Windows also sends the WM_SETFONT message before the control windows
  are created. You can override the OnInitDialog and OnSetFont member
  functions to provide special handling of these messages.
 
  The CreateIndirect member function returns immediately after it creates
  the dialog box.
 
  Use the WS_VISIBLE style in the dialog-box template if the dialog box
  should appear in the parent window upon creation. You can also specify
  other dialog styles in the template as explained in the Windows Software
  Development Kit documentation. These include styles that specify:
 
  ■   The frame around the dialog box.
 
  ■   Whether the dialog window is a pop-up or child window.
 
  ■   Whether the dialog box has a border or a Control menu.
 
  ■   How controls are to be grouped and the tabbing order between them.
 
  Use the CWnd::DestroyWindow function to destroy a dialog box created by
  the CreateIndirect function.
 
  A dialog box can contain up to 255 controls.
 
  Return Value
 
  TRUE if the dialog was created and initialized successfully; otherwise
  FALSE.
 
  See Also
 
  CDialog::Create, CWnd::DestroyWindow, WM_INITDIALOG, WM_SETFONT
 
 
                                     -♦-