求教大虾,多文档工程中怎样在程序开始就出现多个文档视窗?
我试了下面办法:
例如工程名app,则在app.cpp中,
在 AddDocTemplate(pDocTemplate); 后面加一个AddDocTemplate( new CMultiDocTemplate() );程序运行时会出现提示,有两个文档,问我打开哪个?
并不是同时将两个文档一起打开。我该怎么办?

解决方案 »

  1.   

    重载App::OnFileNew()
    {
             POSITION curTemplatePos = GetFirstDocTemplatePosition(); while(curTemplatePos != NULL)
    {
    CDocTemplate* curTemplate = GetNextDocTemplate(curTemplatePos); curTemplate->OpenDocumentFile(NULL);

    }
    }App::InitInstance()中后面修改为
    /* // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing; // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
    return FALSE;
    */
    // The main window has been initialized, so show and update it.
    OnFileNew();
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow();         return TRUE;