找到几个SDI中实现的多视图例子,现在想实现MDI中的多视图,运行界面类似VISUAL STUDIO 6.0的样子,可支持TXT,位图,表格及曲线等类型的文档。找到一段代码,但运行有问题,View不出来!void CDemoDoc::OnViewFormview() 
{
// TODO: Add your command handler code hereCMDIFrameWnd *pMainWnd = (CMDIFrameWnd*)AfxGetMainWnd();
// Get the active MDI child window.
CMDIChildWnd* pChild = (CMDIChildWnd*)pMainWnd->MDIGetActive ();CRuntimeClass *pNewViewClass = RUNTIME_CLASS(CMyView);
CView* pNewView = (CView*)pNewViewClass->CreateObject();
if(pNewView == NULL)
{
TRACE("Warning: Dynamic create of view type %Fs failed\n",
pNewViewClass->m_lpszClassName);
return;
}// Draw new view.
CCreateContext context;
context.m_pNewViewClass = pNewViewClass;
context.m_pCurrentDoc = NULL;
context.m_pNewDocTemplate = NULL; // This view is not attached to any document
//context.m_pNewDocTemplate = This; // This view is not attached to current document
context.m_pLastView = NULL;
context.m_pCurrentFrame = pChild;
if(!pNewView->Create (NULL,NULL,AFX_WS_DEFAULT_VIEW, CRect(0,0,0,0),
pChild,AFX_IDW_PANE_FIRST+1, &context))
{
TRACE("Warning: couldn't create view for frame\n");
delete pNewView;
return;
}pNewView->SendMessage (WM_INITIALUPDATE, 0, 0); // WM_INITIALUPDATE is defined in afxpriv.h
pChild->RecalcLayout ();
pNewView->UpdateWindow ();
pChild->SetActiveView (pNewView);
}困扰我几天了,请高手指点一下!严重谢谢!