Вобщим спасибо господа и дамы за внимание, я решил проблему:
Код | void CMyFormView18::OnBnClickedButton1() { // TODO: Add your control notification handler code here CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd); CDocument* pDoc= pFrame->GetActiveDocument(); CView* pCurrView = pFrame->GetActiveView(); CView* pNewView = new CMyFormView19(); pNewView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, pFrame->rectDefault, pFrame, AFX_IDW_PANE_FIRST, NULL); pNewView->OnInitialUpdate(); pNewView->ShowWindow(SW_SHOW); pCurrView->ShowWindow(SW_HIDE); pDoc->AddView(pNewView); pDoc->RemoveView(pCurrView); pFrame->SetActiveView(pNewView); pFrame->RecalcLayout(); }
|
Код | void CMainFrame::OnNew() { // TODO: Add your command handler code here CDocument* pDoc= GetActiveDocument(); CView* pCurrView = GetActiveView(); CView* pNewView = new CFishfarmingView(); pNewView->Create(NULL, NULL, AFX_WS_DEFAULT_VIEW, rectDefault, this, AFX_IDW_PANE_FIRST, NULL); pNewView->OnInitialUpdate(); pNewView->ShowWindow(SW_SHOW); pCurrView->ShowWindow(SW_HIDE); pDoc->AddView(pNewView); pDoc->RemoveView(pCurrView); SetActiveView(pNewView); RecalcLayout(); }
|
|