Number of Files in Recent Filelist

Hallo everybody,

When creating mfc projects, it is possible to set the number of files to be displayed in the recent filelist.My question is once i have created the project with the wizard, how can i change the number of files to be displayed,  later without starting from scratch

Thanks n Regards




Answer this question

Number of Files in Recent Filelist

  • Morna

    Thank you Ronal for ur reply. I di'nt add to the rc file anything.Only thing what i did is
    CWinApp::LoadStdProfileSettings(13).I have taken over a project and i don't have anay idea why it worked without adding to string table. In the Project CWinApp::LoadStdProfileSettings()  was called without any parameter.But it still kept 4 files in the MRU.May be its the default.When i keep the mouse over it, it shows 4 eventhough no parameter.Is that default

    Here the code:
    void CWinbib3App::LoadStdProfileSettings()
    {                                                             
     CString s;
     CWinApp::LoadStdProfileSettings(13);
     // View Preferences
     m_prfView.uOffset=GetProfileInt(szPrefSection,szOffsetItem,3);
     m_prfView.uSizePercent=max(10,GetProfileInt(szPrefSection,szSizeItem,100));
     m_prfView.bMaximized=(BOOL)GetProfileInt(szPrefSection,szMaximizedItem,TRUE);
     m_prfView.bChildMaximized=(BOOL)GetProfileInt(szPrefSection,szChildMaximizedItem,FALSE);
     m_prfView.nPicPanePercent=max(0,GetProfileInt(szPrefSection,szPicSizeItem,20));
     
     for (int i=0;i<PRF_MAXROWS;i++)
      {                                                  
       char st[20];
       static char BASED_CODE szFmt[]="%d";              
       sprintf(st,szFmt,i);
       m_prfView.anRowWidthIdea=max(0,GetProfileInt(szRowSection,st,50));
      }
     bProfileLoaded=TRUE;
    }

    However it helped me and thanks for ur response..
    swingme

  • russian

    Add the right number of Strings in the string table (in the ProjectName.rc file). E.g. to go from 4 to 13 add
     ID_FILE_MRU_FILE5       "Open this document"
     ID_FILE_MRU_FILE6       "Open this document"
     ID_FILE_MRU_FILE7       "Open this document"
     ID_FILE_MRU_FILE8       "Open this document"
     ID_FILE_MRU_FILE9       "Open this document"
     ID_FILE_MRU_FILE10      "Open this document"
     ID_FILE_MRU_FILE11      "Open this document"
     ID_FILE_MRU_FILE12      "Open this document"
     ID_FILE_MRU_FILE13      "Open this document"
     ID_FILE_MRU_FILE14      "Open this document"
     ID_FILE_MRU_FILE15      "Open this document"
     ID_FILE_MRU_FILE16      "Open this document"

    after the ones already there

     ID_FILE_MRU_FILE1       "Open this document"
     ID_FILE_MRU_FILE2       "Open this document"
     ID_FILE_MRU_FILE3       "Open this document"
     ID_FILE_MRU_FILE4       "Open this document"

    And change the call to LoadStdProfileStrings in MyAppNAmeApp::InitInstance from passing 4 to passing 13:

    LoadStdProfileSettings(13);  // Load standard INI file options (including MRU)

    Ronald Laeremans
    Visual C++ team


  • Number of Files in Recent Filelist