Removing items from MRU

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Alvaro Palma (invalid_address_at_invalid_domain.com)
Date: 10/06/04


Date: Wed, 6 Oct 2004 15:15:56 -0400

I've an MDI application with an MRU, which is populated from CMainFrame
using
AfxGetApp()->AddToRecentFileList(myFilePath).

My question is: Is there some way to do the opposite (remove an item from
the
MRU) without having to implement functions in the CWinApp derived class?

What I mean is that I can remove items from the MRU by placing a function in
the CWinApp derived class, such as

CWinApp::RemoveItem(int ID_file_to_remove)
{
    m_pRecentFileList->Remove(ID_file_to_remove);
}

and call it from the CMainFrame as ((CMyWinApp
*)AfxGetApp())->RemoveItem(...), but
I don't want to modify the CWinApp based class. I've to write this wrapper
if I want to do it
this way, since I can't get direct access to m_pRecentFileList by using
AfxGetApp, cause is
a private member of CWinApp.

In short, is there any function in the API to erase items from the MRU
without having to
add code to the CWinApp derived class? (something like
AfxGetApp()->RemoveFromFileList(myFileID))

Thanks a lot