问题是这样的:多文档视图,我在NDMSAPP类的InitInstance()设置了先不打开文档,然后在Return True之前弹出了登陆对话框,可这时菜单栏并没有显示出来,工具栏却显示出来了。
   如果对话框关闭,则菜单栏也能显示出来;如果我不在InitInstance()设置先不打开文档也可以正常显示菜单栏。
   请教各位,如果在对话框弹出的时候菜单栏能够正常显示,多谢各位了,在线等!

解决方案 »

  1.   

    模式对话框也可以的,如 // The main window has been initialized, so show and update it.
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow(); CAboutDlg dlg;
    dlg.DoModal();
    return TRUE;
      

  2.   

    我就是按照横秋说的那样加的,在NDMSAPP类的InitInstance()中
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow();CLoginDlg dlg;
    dlg.DoModal();return TRUE;前面生成主框架的语句是:
    CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CNDMSDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CNDMSView));
    AddDocTemplate(pDocTemplate);
    然后我选择了不打开文档:
    CMainFrame* pMainFrame = new CMainFrame;
    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
    return FALSE;
    m_pMainWnd = pMainFrame; m_pMainWnd->DragAcceptFiles(); EnableShellOpen();
    RegisterShellFileTypes(TRUE); // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo); if(cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew)
    {
    cmdInfo.m_nShellCommand=
    CCommandLineInfo::FileNothing;      
    } // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
    return FALSE;