Print Page | Close Window

Multiple MRU Lists

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14450
Printed Date: 28 May 2025 at 5:27pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Multiple MRU Lists
Posted By: dawiebe
Subject: Multiple MRU Lists
Date Posted: 04 June 2009 at 10:15am
Hello,

I have been using other tutorials in VC++6.0 to use multiple MRU lists, ( http://www.codeguru.com/cpp/w-d/doc_view/mrumostrecentusedfilelist/article.php/c3297 - http://www.codeguru.com/cpp/w-d/doc_view/mrumostrecentusedfilelist/article.php/c3297 ), however when it goes to update the MRU Menu,

Code:

void CRecentFileList::UpdateMenu(CCmdUI* pCmdUI)
{
    ASSERT(m_arrNames != NULL);

    CMenu* pMenu = pCmdUI->m_pMenu;
    if (m_strOriginal.IsEmpty() && pMenu != NULL)
        pMenu->GetMenuString(pCmdUI->m_nID, m_strOriginal, MF_BYCOMMAND);

    if (m_arrNames[0].IsEmpty())
// There are items in the array list,
    {                            //
so it skips over this if-statement
        // no MRU files
        if (!m_strOriginal.IsEmpty())
            pCmdUI->SetText(m_strOriginal);
        pCmdUI->Enable(FALSE);
        return;
    }

    if (pCmdUI->m_pMenu == NULL)
// But m_pMenu always ends up being null,
       
return;                  // and it doesn't actually add the MRU files
                                 // to the menu bar list.


    for (int iMRU = 0; iMRU < m_nSize; iMRU++)
        pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID + iMRU, MF_BYCOMMAND);

  ............
}


In the MRU list on the menu bar, there ends up being one item which I can highlight and click on, but it has no name.


I have searched the forums, and I have found a similar request here:
https://forum.codejock.com/forum_posts.asp?TID=2848&KW=&PID=49606#49606 - https://forum.codejock.com/forum_posts.asp?TID=2848&KW=&PID=49606#49606
however the files that were provided are no longer accessable.

Thanks

Dave



Replies:
Posted By: Oleg
Date Posted: 09 June 2009 at 1:57am
Hi,
 
Here one sample
http://forum.codejock.com/uploads/20090609_015657_MRUSample.zip - MRUSample.zip


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dawiebe
Date Posted: 09 June 2009 at 4:35pm
Wow, that was perfect.

Thank you so much for your help!

Dave



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