att.

解决方案 »

  1.   

    譬如说一个是CFormView, 另外一个是CListView
      

  2.   

    first ; you should add your own View class to your projet,
    after that , you add code like this in the app file:
    m_pDocTemplateform = new CMultiDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CYourDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CYourFormView));
    AddDocTemplate(m_pDocTemplateform); m_pDocTemplatelist = new CMultiDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CYourDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CYourListView));
    AddDocTemplate(m_pDocTemplatelist);that's ok.display the new View; 
    for example:
    void CTSMLApp::OnView2() 
    {
    CChildFrame* pFrame = new CChildFrame();
    CCreateContext context;
    context.m_pCurrentDoc=mp_doc; //that's the way I avoid to create new document every time I open a new view
    context.m_pNewViewClass=RUNTIME_CLASS(CTSMLPicView);
    context.m_pNewDocTemplate=pDocTemplate;
    context.m_pLastView=(((CMainFrame *)m_pMainWnd)->GetActiveFrame() ? ((CMainFrame *)m_pMainWnd)->GetActiveFrame()->GetActiveView() : NULL);
    context.m_pCurrentFrame=((CMainFrame *)m_pMainWnd)->GetActiveFrame();
    if (!pFrame->LoadFrame(IDR_TSMLPICTYPE,WS_OVERLAPPEDWINDOW | FWS_PREFIXTITLE ,m_pMainWnd, &context ))return;
    pFrame->InitialUpdateFrame(mp_doc,TRUE);
    }