MFC MDI框架,加载了CFromView视图,视图上有控件,但是一切换程序,CFromView视图和视图上的控件消失
MainFrm中的OnCreate函数CCreateContextcontext;CChildFrame*ChildF;ChildF=newCChildFrame();c...
MainFrm中的OnCreate函数
CCreateContext context;
CChildFrame *ChildF;
ChildF = new CChildFrame();
context.m_pNewViewClass = RUNTIME_CLASS(CFormDlg);
context.m_pCurrentDoc = new TestDoc();
if (!ChildF->LoadFrame(IDR_MAINFRAME,WS_OVERLAPPEDWINDOW&(~WS_MAXIMIZEBOX)&(~WS_THICKFRAME),this,&context))
{
AfxMessageBox(_T("加载出错!"));
}
ChildF->SetWindowText(_T("PowerMac"));
ChildF->MoveWindow(CRect(0,0,500,500));
Sleep(700);
ChildF->ShowWindow(SW_SHOWNORMAL);
ChildF->InitialUpdateFrame(NULL,true);
UpdateWindow(); 展开
CCreateContext context;
CChildFrame *ChildF;
ChildF = new CChildFrame();
context.m_pNewViewClass = RUNTIME_CLASS(CFormDlg);
context.m_pCurrentDoc = new TestDoc();
if (!ChildF->LoadFrame(IDR_MAINFRAME,WS_OVERLAPPEDWINDOW&(~WS_MAXIMIZEBOX)&(~WS_THICKFRAME),this,&context))
{
AfxMessageBox(_T("加载出错!"));
}
ChildF->SetWindowText(_T("PowerMac"));
ChildF->MoveWindow(CRect(0,0,500,500));
Sleep(700);
ChildF->ShowWindow(SW_SHOWNORMAL);
ChildF->InitialUpdateFrame(NULL,true);
UpdateWindow(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询