Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MRU list

39 views
Skip to first unread message

Todd Parkin

unread,
May 12, 2003, 4:47:14 PM5/12/03
to
I want to change the number of files listed in the MRU but I want to do it
dynamically while the application is running. Meaning it has already gone
through the InitInstance call and I can no longer call
LoadStdProfileSettings.

Basically what I'm doing is giving the user the option to change the lists
size on the fly. The choose a user options button, a dialog pops up with
the MRU size field. From here they choose a number from the dropdown and I
would like to tell the application to display only that many files. Using
LoadStdProfileSettings doesn't work because the m_pRecentFileList must be
NULL and is not. This is why it can only be called from InitInstance. Does
anyone have some type of work around for this problem?

Thanks,
Todd


Devikala Natarajan

unread,
May 12, 2003, 6:12:50 PM5/12/03
to
Hi Todd,

You can perform the required operation using CRecentFileList. If needed i
will provide you the sample code or example.

Good Luck.

Using CRecentFile
"Todd Parkin" <IHat...@Myemail.com> wrote in message
news:#eguseMG...@TK2MSFTNGP10.phx.gbl...

Todd Parkin

unread,
May 13, 2003, 6:58:54 PM5/13/03
to
OK. I tried to use the CRecentFileList like you suggested but it seems to
remove all the files and just leave the "Recent Files" text in their place.
Here is the code I used:

void TACEApp::OnUpdateFileMruFile1(CCmdUI* CmdUI)
{
// Update the Most Recent Used file list.
CRecentFileList rfl(0, "Recent File List", "File%d", 10);

int ListSize = m_UserOptions->GetMRUSize();
for (int i = 0; i < ListSize; i++)
{
if (i >= ListSize)
rfl.Remove(i);
}
rfl.UpdateMenu(CmdUI);
}

Here is the call in the message map:
ON_UPDATE_COMMAND_UI(ID_FILE_MRU_FILE1, OnUpdateFileMruFile1)

I call this from within a class that is derived from CWinApp.

I just wanted it to remove the files greater than the ListSize.

Thanks,
Todd

"Devikala Natarajan" <Devi...@speakeasy.net> wrote in message
news:Qo2cnWWsM-7...@speakeasy.net...

0 new messages