Print Page | Close Window

MRU CFileList implementation incorrect.

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11116
Printed Date: 01 March 2025 at 3:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MRU CFileList implementation incorrect.
Posted By: rramsay
Subject: MRU CFileList implementation incorrect.
Date 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?



Replies:
Posted By: Oleg
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net