![]() |
MRU CFileList implementation incorrect. |
Post Reply ![]() |
Author | |
rramsay ![]() Newbie ![]() Joined: 19 June 2008 Location: United States Status: Offline Points: 1 |
![]() ![]() ![]() ![]() ![]() 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? |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Please search in this forum. There was samples for Recent list.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |