如果是0,OnFileNew.
如果是1,不动。

解决方案 »

  1.   

    这要看你的程序里面有几个文档模板,
    如果只有一个文档模板,实现下面的函数:
    if (L==0)

     POSITION pos;
     CDocument *pDoc;
     CFrameWnd *pFrame;
     pos=theApp.m_pDocTemplate->GetFirstDocPosition();
     pDoc=theApp.m_pDocTemplate->GetNextDocPosition(pos);
     pFrame=theApp.m_pDocTemplate->CreateNewFrame(pDoc,NULL);
     if (pFrame==NULL)
     {
     AfxMessageBox("the create new view is   wrong!");
     return NULL;
    }
    ASSERT_KINDOF(CFrameWnd,pFrame);
    theApp.m_pDocTemplate->InitalUpdateFrame(pFrame,pDocument);
    }
    多文档模板一样,先根据文档模板创建相应的框架窗口(CreateNewFrame),在实现框架窗体
    自我更新(InitialUpdateFrame(pFrame,pDocument);
    但是需要注意的是:文档必须对应相应的视