1.现在看了点孙鑫MFC的视频,发现都是介绍单文档应用程序的,没有多文档应用程序,学了点单文档,但还是不知道MFC多文档应用程序怎么编程,大家有没有好的教材介绍MFC多文档编程的,推荐下
2.多文档编程默认的程序,一开始就会出现个空白doc 视图,怎么消除请大家不吝赐教!

解决方案 »

  1.   

    第二个问题好解决,App中添加一行代码就OK
    如下红色部分:
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo); cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;第一个就要多看网络资料了.
      

  2.   

    1.多文档可以上MSDN文档看下,里面也有相关的案例。在网上就有很多关于这个方面的教材。可以在上面找一下。2.BOOL CXXApp::InitInstance()
    {
    AfxEnableControlContainer(); // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.#ifdef _AFXDLL
    Enable3dControls(); // Call this when using MFC in a shared DLL
    #else
    Enable3dControlsStatic(); // Call this when linking to MFC statically
    #endif // Change the registry key under which our settings are stored.
    // TODO: You should modify this string to be something appropriate
    // such as the name of your company or organization.
    SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings();  // Load standard INI file options (including MRU) // Register the application's document templates.  Document templates
    //  serve as the connection between documents, frame windows and views. CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    IDR_MY111TYPE,
    RUNTIME_CLASS(CMy111Doc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CMy111View));
    AddDocTemplate(pDocTemplate); // create main MDI Frame window
    CMainFrame* pMainFrame = new CMainFrame;
    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
    return FALSE;
    m_pMainWnd = pMainFrame; // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
    // if (!ProcessShellCommand(cmdInfo))  //注释掉这行
    // return FALSE;               //注释掉这行 // The main window has been initialized, so show and update it.
    pMainFrame->ShowWindow(m_nCmdShow);
    pMainFrame->UpdateWindow(); return TRUE;
    }
      

  3.   

    其实感觉sun 的视频不是很好!
      

  4.   

    呵呵 我也准备看sun的视频