CRecentFileList Class
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

CRecentFileList Class 

This topic has been updated for Visual Studio 2005 SP1.

Supports control of the most recently used (MRU) file list.

class CRecentFileList

Files can be added to or deleted from the MRU file list, the file list can be read from or written to the registry or an .INI file, and the menu displaying the MRU file list can be updated.

For more information about MRU menu items, see

  • Knowledge Base article Q243751 : HOWTO: Add Command Handlers for MRU Menu Items in MFC Application

Header: afxadv.h

This section has been updated for Visual Studio 2005 SP1.

Starting in Visual Studio 2005 SP1, this class is supported in Smart Device projects.

To use CRecentFileList in smart device doc/view architecture projects, your project must utilize macros defined in the header file MRUMacros.h.

Make the following modifications in various files generated by the MFC device application wizard in order to use CRecentFileList.

  • In the file <ProjectName>Doc.h

    • Include the header file by adding #include "MRUMacros.h" at the top

    • Add the macro DECLARE_MRU_DOC_SUPPORT(C<ProjectName>Doc) to the C<ProjectName> class.

  • In the file <ProjectName>.h

    • Include the header file by adding #include "MRUMacros.h" at the top

    • Add the macro DECLARE_MRU_APP_SUPPORT(C<ProjectName>App) to the <ProjectName>App class

  • In the file <ProjectName>.cpp

    • Add the macro MRU_INIT() in constructor of C<ProjectName>App class

    • Add the macro MRU_DESTROY() in the destructor of C<ProjectName>App class.

    • Add the macro IMPLEMENT_MRU_APP_SUPPORT(C<ProjectName>App,CWinApp) at the bottom.

    • Add the macro MRU_MESSAGE_MAP_ENTRIES(C<ProjectName>App) between BEGIN_MESSAGE_MAP(C<ProjectName>App, CWinApp) and END_MESSAGE_MAP()

© 2016 Microsoft