int CMDITabChildWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (__super::OnCreate(lpCreateStruct) == -1) return -1; // Unfortunately, we can't update our title until we have a document - // which we do not have yet. So there will be a little visual glitch as // the tab is added, and *then* gets it title. CMainFrame *pFrame = static_cast<CMainFrame*>(AfxGetMainWnd()); if (pFrame) { pFrame->AddTab(this, GetTabType()); } return 0; }