BOOL CMsgManage::OnInitDialog()
{
CDialog::OnInitDialog();
CFrameWnd* pFrameWnd = new CFrameWnd();
CRect rec;
GetDlgItem(IDC_VIEW_ADGE)->GetWindowRect(rec);
ScreenToClient(rec);
pFrameWnd->Create(NULL,NULL,WS_VISIBLE|WS_CHILD,rec,this);
CCreateContext cc;
cc.m_pCurrentDoc = m_pDoc;
cc.m_pNewViewClass = RUNTIME_CLASS(CUIView);
CUIView *pView=(CUIView *)((CFrameWnd*)pFrameWnd)->CreateView(&cc);
pView->UpdateWindow();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
其中m_pDoc是当前DOC类的一个指针,在对话框DOMODAL之前赋值;