CView *pOldActiveView=GetActiveView();
 CView  *pNewActiveView=(CView *)GetDlgItem(nForm); 
if(pNewActiveView==NULL)
 {  
switch(nForm)//nForm是对话框ID;
    {
    case IDD_MULTISCREEN_FORM1:
        pNewActiveView=(CView *)new CView1;
         break;
case IDD_MULTISCREEN_FORM2:
        pNewActiveView=(CView *)new CView2;
         break;
case IDD_MULTISCREEN_FORM3:
        pNewActiveView=(CView *)new CView3;
           break;    }
  CCreateContext context;    //将文档和视图相连
  context.m_pCurrentDoc=pOldActiveView->GetDocument();
  pNewActiveView-〉Create(NULL,NULL,WS_CHILD,
            CFrameWnd::rectDefault,this,nForm,&context);
        pNewActiveView->OnInitialUpdate();
编译错误:pNewActiveView->OnInitialUpdate();
    Variaries窗口:
- &context 0x0012fa14
- m_pNewViewClass 0x00000000 {???}
m_lpszClassName CXX0030: Error: expression cannot be evaluated
m_nObjectSize CXX0030: Error: expression cannot be evaluated
m_wSchema CXX0030: Error: expression cannot be evaluated
m_pfnCreateObject CXX0030: Error: expression cannot be evaluated
m_pfnGetBaseClass CXX0030: Error: expression cannot be evaluated
m_pNextClass CXX0030: Error: expression cannot be evaluated
+ m_pCurrentDoc 0x00421540 {CMultiScreenDoc}
- m_pNewDocTemplate 0x00000000 {CDocTemplate}
CCmdTarget CXX0030: Error: expression cannot be evaluated
m_bAutoDelete CXX0030: Error: expression cannot be evaluated
m_pAttachedFactory CXX0030: Error: expression cannot be evaluated
m_hMenuInPlace CXX0017: Error: symbol "" not found
m_hAccelInPlace CXX0017: Error: symbol "" not found
m_hMenuEmbedding CXX0030: Error: expression cannot be evaluated
m_hAccelEmbedding CXX0030: Error: expression cannot be evaluated
m_hMenuInPlaceServer CXX0030: Error: expression cannot be evaluated
m_hAccelInPlaceServer CXX0030: Error: expression cannot be evaluated
m_nIDResource CXX0030: Error: expression cannot be evaluated
m_nIDServerResource CXX0030: Error: expression cannot be evaluated
m_nIDEmbeddingResource CXX0030: Error: expression cannot be evaluated
m_nIDContainerResource CXX0030: Error: expression cannot be evaluated
m_pDocClass CXX0030: Error: expression cannot be evaluated
m_pFrameClass CXX0030: Error: expression cannot be evaluated
m_pViewClass CXX0030: Error: expression cannot be evaluated
m_pOleFrameClass CXX0030: Error: expression cannot be evaluated
m_pOleViewClass CXX0030: Error: expression cannot be evaluated
+ m_strDocStrings {???}
+ m_pLastView 0x00000000 {CView hWnd=???}
+ m_pCurrentFrame 0x00000000 {CFrameWnd hWnd=???}
nForm 131
- pNewActiveView 0x00422230 {CView hWnd=0xdddddddd}
+ CWnd {CWnd hWnd=0xdddddddd}
+ m_pDocument 0xdddddddd {CDocument}
- this 0x00421330 {CMainFrame hWnd=0x0007037a}
+ CFrameWnd {CFrameWnd hWnd=0x0007037a}
+ classCMainFrame {"CMainFrame"}
m_bFirst 0
+ m_wndStatusBar {CStatusBar hWnd=0x0002043e}
+ m_wndToolBar {CToolBar hWnd=0x00060378}
+ _messageEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const  CMainFrame::_messageEntries
- messageMap {...}
pfnGetBaseMap 0x004010eb CMainFrame::_GetBaseMessageMap(void)
+ lpEntries 0x00417040 struct AFX_MSGMAP_ENTRY const * const  CMainFrame::_messageEntries

解决方案 »

  1.   

    Can you give your souce code?
    So I can help you.
    [email protected]
    http://rosement.diy.163.com
      

  2.   

    原代码不全啊~~~~~!
    压成ZIP文件~!放个空间上~~~~~给人下啊!
      

  3.   

    你们留下E_mail 我传给你门!!
      

  4.   

    我做成了一个,下面是关键代码,如果还不行,email [email protected]我把完整的程序发给你。
    void CMainFrame::SwitchForm(int nFormID)
    {

    CView* pOldView=GetActiveView();
    CView* pNewView=(CFormView*)GetDlgItem(nFormID);

    if(pNewView==NULL)
    {
    switch(nFormID)
    {

    case IDD_FILE_TRANSFER:
    pNewView=(CView*)new CFile_Transfer;
    break;
    case  IDD_ILLPC_FORM:
    pNewView=(CView*)new CIllpcView;
    break;
    case  IDD_SCANCER:
    pNewView=(CView*)new CSCAN;
    break;


    default:
    break;
    }

    CCreateContext context;
    context.m_pCurrentDoc=pOldView->GetDocument();
    pNewView->Create(NULL,NULL,0L,CFrameWnd::rectDefault,
    this,nFormID,&context);
    pNewView->OnInitialUpdate();
    }

        SetActiveView(pNewView);
    pNewView->ShowWindow(SW_SHOW);
    pOldView->ShowWindow(SW_HIDE);
        

    if(pOldView->GetRuntimeClass()==RUNTIME_CLASS(CFile_Transfer))
    {
    pOldView->SetDlgCtrlID(IDD_FILE_TRANSFER);
    }
    else if(pOldView->GetRuntimeClass()==RUNTIME_CLASS(CIllpcView))
    {
    pOldView->SetDlgCtrlID(IDD_ILLPC_FORM);
    }
    else 
    {
    pOldView->SetDlgCtrlID(IDD_SCANCER);
    }
    pNewView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);

    RecalcLayout();
    }