使用Wizard创建了一多文档程序,程序在启动后总是自动新建一个空文档,WIZARD新建空文档的代码在哪?怎样才能让程序在启动后不自动新建空文档了?

解决方案 »

  1.   

    这是我的一个程序中的代码:
    BOOL CAcct_Price_ManageDoc::OnNewDocument()
    {
    //if (!CDocument::OnNewDocument())
    //不要缺省视图
    return FALSE; // TODO: add reinitialization code here
    // (SDI documents will reuse this document) return TRUE;
    }
      

  2.   

    这个方法我知道,不过这样的话我如果用到OnNewDocument新建一个文档的话就总是return false。
    应该这样:
    // Do not display a new MDI child window during startup.
       cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
      

  3.   

    为了去掉开始的子窗口,可在应用程序文件
    分析命令行的语句  CCommandLineInfo cmdInfo;  ParseCommandLine(cmdInfo);  后加入:  cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;
      

  4.   

    在你的XXXXAPP类的InitInstance函数内部,修改以下语句块
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;//添加语句   
    if (!ProcessShellCommand(cmdInfo))
      return FALSE;
      

  5.   

    在你的XXXAPP类的InitInstance函数内部,修改以下语句块
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    cmdInfo.m_nShellCommand=CCommandLineInfo::FileNothing;//添加语句   
    if (!ProcessShellCommand(cmdInfo))
      return FALSE;