Listing 6 The CRecentFileListEx() function
class CRecentFileListEx : public CRecentFileList { public: CRecentFileListEx(UINT nStart, LPCTSTR lpszSection, LPCTSTR lpszEntryFormat, int nSize, int nMaxDispLen = AFX_ABBREV_FILENAME_LEN): CRecentFileList(nStart, lpszSection, lpszEntryFormat, nSize, nMaxDispLen) { } BOOL GetDisplayName(CString& strName, int nIndex, LPCTSTR lpszCurDir, int nCurDir, BOOL bAtLeastName = TRUE) const; }; BOOL CRecentFileListDlgApp::InitInstance() { ... LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Delete the m_pRecentFileList created in the LoadStdProfileSettings. delete m_pRecentFileList; // The nSize argument of the constructor is set to four because the // LoadStdProfileSettings takes a default of four. If you specify a // different value for the nMaxMRU argument you need to change the // nSize argument for the constructor call. m_pRecentFileList = new CRecentFileListEx(0, FileSection, FileEntry, 4); m_pRecentFileList->ReadList(); ... }