本帖最后由 chenquangobeijing 于 2012-11-09 11:26:59 编辑

解决方案 »

  1.   

    CView  *pNewView = new CNewView; 
    CFrameWnd* pFrame = new CFrameWnd;
           
    CCreateContext newContext;  
    newContext.m_pNewViewClass = NULL; 
        newContext.m_pNewDocTemplate = NULL;  
    newContext.m_pLastView = pNewView;  
    newContext.m_pCurrentFrame = pFrame;   
    newContext.m_pCurrentDoc =NULL;  
    pFrame->Create(NULL, _T("My Windows"), WS_OVERLAPPEDWINDOW, CFrameWnd::rectDefault, NULL, NULL, 0, &newContext);
    pNewView->Create(NULL,NULL, WS_CHILD | WS_VISIBLE,CFrameWnd::rectDefault,pFrame,AFX_IDW_PANE_FIRST,&newContext);   
    pFrame->ShowWindow(SW_SHOW);
    pNewView->OnInitialUpdate();
    一般都这么写的