界面挂载通用代码

在MFC框架下将CInfoDlg界面挂载到主页面

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Context.m_pNewViewClass = RUNTIME_CLASS(CInfoDlg);

Context.m_pCurrentFrame = this;

Context.m_pLastView = (CFormView *)m_spliter.GetPane(0, 1);

m_spliter.DeleteView(0, 1);

m_spliter.CreateView(0, 1, RUNTIME_CLASS(CInfoDlg), CSize(600, 0), &Context);

CInfoDlg *pNewView = (CInfoDlg *)m_spliter.GetPane(0, 1);

m_spliter.RecalcLayout();

pNewView->OnInitialUpdate();

m_spliter.SetActivePane(0, 1);