CMDIFrameWnd::CreateNewChild
Visual Studio 2012
Creates a new child window.
CMDIChildWnd* CreateNewChild( CRuntimeClass* pClass, UINT nResource, HMENU hMenu = NULL, HACCEL hAccel = NULL );
// CMainFrame is a CMDIFrameWnd-derived class, // OnNewDraw is a menu command handler, // CDrawFrame is a CMDIChildWnd-derived class. void CMainFrame::OnNewDraw() { CreateNewChild(RUNTIME_CLASS(CDrawFrame), IDR_DRAW, m_hDrawMenu, m_hDrawAccel); }
This example is an excerpt from Knowledge Base article Q201045, "HOWTO: Add Multiple Window Types to a Non-Document/View MDI App." Knowledge Base articles are available in the MSDN Library Visual Studio documentation or at http://support.microsoft.com.