void CDesktopApp::OnSillyPaste() { CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd); // create a new MDI child window pFrame->CreateNewChild( RUNTIME_CLASS(CPrintingFrame), IDR_DesktopTYPE, m_hMDIMenu, m_hMDIAccel); // application fail around this line during runtime of release version. but debug version perform normal. //definition of CPrintingFrame /* class CPrintingFrame: public CMDIChildWndEx {}; */ //IDR_DesktopTYPE is a macro with value 130 //hMDIMenu is HMENU type; //m_hMDIAccel is HACCEL type; } //another function that behave well void CDesktopApp::OnCustomerFileRequest() { CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd); // create a new MDI child window pFrame->CreateNewChild( RUNTIME_CLASS(CCustomerReportFrm), IDR_DesktopTYPE, m_hMDIMenu, m_hMDIAccel); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)