LRESULT CDialog::HandleInitDialog(WPARAM, LPARAM) { PreInitDialog(); #ifndef _AFX_NO_OCC_SUPPORT // create OLE controls COccManager* pOccManager = afxOccManager; if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL)) { BOOL bDlgInit; if (m_lpDialogInit != NULL) bDlgInit = pOccManager->CreateDlgControls(this, m_lpDialogInit, m_pOccDialogInfo); else bDlgInit = pOccManager->CreateDlgControls(this, m_lpszTemplateName, m_pOccDialogInfo); if (!bDlgInit) { TRACE0("Warning: CreateDlgControls failed during dialog init.\n"); EndDialog(-1); return FALSE; } } #endif // Default will call the dialog proc, and thus OnInitDialog BOOL bResult = Default(); #ifndef _AFX_NO_OCC_SUPPORT if (bResult && (m_nFlags & WF_OLECTLCONTAINER)) { CWnd* pWndNext = GetNextDlgTabItem(NULL); if (pWndNext != NULL) { pWndNext->SetFocus(); // UI Activate OLE control bResult = FALSE; } } #endif return bResult; }
LRESULT CFormView::HandleInitDialog(WPARAM, LPARAM) { Default(); // allow default to initialize first (common dialogs/etc) // create OLE controls COccManager* pOccManager = afxOccManager; if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL)) { if (!pOccManager->CreateDlgControls(this, m_lpszTemplateName, m_pOccDialogInfo)) { TRACE0("Warning: CreateDlgControls failed during form view init.\n"); return FALSE; } } return FALSE; // don't set focus until later }
LRESULT CBCGDialogBar::HandleInitDialog(WPARAM, LPARAM) { Default(); // allow default to initialize first (common dialogs/etc) // create OLE controls COccManager* pOccManager = afxOccManager; if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL)) { if (!pOccManager->CreateDlgControls(this, m_lpszTemplateName, m_pOccDialogInfo)) { TRACE (_T("Warning: CreateDlgControls failed during dialog bar init.\n")); return FALSE; } } return TRUE; }
LRESULT COXSizeDialogBar::HandleInitDialog(WPARAM, LPARAM) { Default(); // allow default to initialize first (common dialogs/etc) // get extension data - for backward compatibility with existing MRCEXT, // this can't be in the base class itself. // create OLE controls COccManager* pOccManager = afxOccManager; if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL)) { if (!pOccManager->CreateDlgControls(this, m_lpszTemplateName, m_pOccDialogInfo)) { TRACE0("Warning: CreateDlgControls failed during dialog bar init.\n"); return FALSE; } } BOOL bResult=OnInitDialog(); return bResult; }
//***************************************************************************************** LRESULT CBCGPDialogBar::HandleInitDialog(WPARAM wParam, LPARAM lParam) { CBCGPBaseControlBar::HandleInitDialog(wParam, lParam); #ifndef _AFX_NO_OCC_SUPPORT Default(); // allow default to initialize first (common dialogs/etc) // create OLE controls COccManager* pOccManager = afxOccManager; if ((pOccManager != NULL) && (m_pOccDialogInfo != NULL)) { if (!pOccManager->CreateDlgControls(this, m_lpszBarTemplateName, m_pOccDialogInfo)) { TRACE (_T("Warning: CreateDlgControls failed during dialog bar init.\n")); return FALSE; } } #endif //!_AFX_NO_OCC_SUPPORT if (IsVisualManagerStyle ()) { m_Impl.EnableVisualManagerStyle (TRUE); m_Impl.m_bTransparentStaticCtrls = FALSE; } if (m_bIsScrollingEnabled) { CRect rectClient; GetClientRect (rectClient); m_scrollSize = rectClient.Size (); } return TRUE; }