多文档中有自带的最近文件列表,默认显示最多为4个,我想获得文件名,然后能打开文件列表中的所有文件,但是响应打开文件列表中的文件的命令消息只有ID_FILE_MRUFILE1。
1.如何获得文件名?
2.如何打开文件列表中的所有文件?
路过的高手请指教,谢谢!!!

解决方案 »

  1.   

    ... ...
    这个找本权威一点的MFC都有吧。
      

  2.   

    // if you want to open a recent file on start up.
    #if 0
    if(cmdInfo.m_strFileName.IsEmpty())
    {
    int Max=RFileList->GetSize();
    if(Max>0)
    {
    CString strFileName;
    strFileName=RFileList->m_arrNames[0];// choose the 1st
    if(strFileName.IsEmpty()) return TRUE;
    OpenDocumentFile(strFileName);
    }
    }
    #endif
      

  3.   

    //more
    CRecentFileList *RFileList;
    BOOL CxxxxApp::InitInstance()
    {

    LoadStdProfileSettings();  // Load standard INI file options (including MRU)
    //  
    RFileList=m_pRecentFileList;

    }
      

  4.   

    1、那怎么实现点击哪个文件就打开哪个呢?
    2、我要调用视图类的一个函数打开最近列表里的文件pview->LoadFile(strFileName),那要怎么实现?
      

  5.   

    1>.
    BOOL CxxxxxDoc::OnOpenDocument(LPCTSTR lpszPathName) 
    {
    if (!CDocument::OnOpenDocument(lpszPathName))// file not exist !
    return FALSE;
    }
    2>.
    void CMainFrame::OnFileMruFile1() 
    {
    // TODO: Add your command handler code here
    FileName=RFileList->m_arrNames[0];
    }
      

  6.   

    OnOpenDocument里怎么调用pview->LoadFile(strFileName)?OnFileMruFile1()只能响应最近文件列表中置顶的文件,怎么实现我点击最近文件列表中哪个文件就调用pview->LoadFile(strFileName)打开?
      

  7.   

    BOOL CxxxxxDoc::OnOpenDocument(LPCTSTR lpszPathName)
      

  8.   

    为什么是pview->LoadFile(strFileName)?这种操作应该在doc中
      

  9.   

    问题已经解决,因为打开的文件要语法加亮的,所以必须要调用视图里的LoadFile函数实现。多谢schlafenhamste!!!