Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - MRU CFileList implementation incorrect.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MRU CFileList implementation incorrect.

 Post Reply Post Reply
Author
Message
rramsay View Drop Down
Newbie
Newbie


Joined: 19 June 2008
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote rramsay Quote  Post ReplyReply Direct Link To This Post Topic: MRU CFileList implementation incorrect.
    Posted: 19 June 2008 at 2:58pm
I am using the CodeJock Command bars and CFileList. Although when I update my CFileList in my mainApp it doesn't update the items in the "Recently Used Files" popup menu.  It does enable the one default item. But does not change the text.

In the resource file I have:
...
IDR_MAIN MENU PRELOAD DISCARDABLE
BEGIN
    POPUP "File"
    BEGIN
        MENUITEM "New"
        MENUITEM "Open"
        MENUITEM "Recent Files",    ID_FILE_MRU_MYFILE1, GRAYED
        POPUP "Recent Files 2"
        BEGIN
            MENUITEM "Default",       ID_FILE_MRU_NEWFILE1
        END
...

In the MyApp.cpp:
BEGIN_MESSAGE_MAP(MyApp, CWinApp)
    ...
    ON_UPDATE_COMMAND_UI(ID_FILE_MRU_MYFILE1, OnUpdateMruMyFiles)
    ...
END_MESSAGE_MAP( )
...
void MyApp::InitInstance()
{
...
    pMRUmyFiles = new CRecentFileList( 0, L"MRU my files",
        L"file_%d", NUM_MRU );
    pMRUmyFiles->ReadList( );
...
}

void MyApp::OnUpdateMruMyFiles( CCmdUI* pCmdUI )
{
    CString     file1 = ( *pMRUmyFiles )[0];
  
    if( file1.IsEmpty( ) )
        pCmdUI->Enable( FALSE );
    else if( pCmdUI->m_pSubMenu == NULL )
    {
        pMRUmyFiles->UpdateMenu( pCmdUI );
        return;
    }
    CWinApp::OnUpdateRecentFileMenu( pCmdUI );
}

In the resource file snippet you can see that I have tried two different methods for creating the menu, neither of those work so must be something else I'm missing. Do I need to use CXTPRecentFileList instead of CRecentFileList?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 19 June 2008 at 3:28pm
Hi,
Please search in this forum. There was samples for Recent list.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.