Print Page | Close Window

Make Recent File

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=2727
Printed Date: 08 November 2025 at 9:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Make Recent File
Posted By: gniwon
Subject: Make Recent File
Date Posted: 16 August 2005 at 12:30am

Hello .

I want to make two "Recent file" menu as "Recent project file" and "Rcent source file", Please help me how to do.


BOOL CPHEzApp::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// TODO: Add your specialized code here and/or call the base class
UINT nMsg = 0;
int nCod = nCode;
WORD m_nMenuPrjId = ID_PROJECT_RECENT;
WORD m_nMenuId1 = ID_FILE_RECENT;
WORD MRU_RANGE = 4;

if (nCod != CN_UPDATE_COMMAND_UI) {
nMsg = HIWORD(nCod);
nCod = LOWORD(nCod);
}

if (nMsg == 0) nMsg = WM_COMMAND;

if ((nCod==CN_UPDATE_COMMAND_UI) && (nID>=m_nMenuPrjId) && (nID<=m_nMenuPrjId+MRU_RANGE))
{
BOOL bResult = TRUE; // default is ok
ASSERT(pExtra != NULL);
CCmdUI* pCmdUI = (CCmdUI*)pExtra;
ASSERT(!pCmdUI->m_bContinueRouting); // idle - not set
UpdateRecentProjectMenu(pCmdUI);
bResult = !pCmdUI->m_bContinueRouting;
pCmdUI->m_bContinueRouting = FALSE; // go back to idle
return bResult;
}

if ((nCod==CN_UPDATE_COMMAND_UI) && (nID>=m_nMenuId1) && (nID<=m_nMenuId1+MRU_RANGE))
{
BOOL bResult = TRUE; // default is ok
ASSERT(pExtra != NULL);
CCmdUI* pCmdUI = (CCmdUI*)pExtra;
ASSERT(!pCmdUI->m_bContinueRouting); // idle - not set
UpdateRecentEctMenu(pCmdUI);
bResult = !pCmdUI->m_bContinueRouting;
pCmdUI->m_bContinueRouting = FALSE; // go back to idle
return bResult;
}

if ((nMsg==WM_COMMAND) && (nCod==CN_COMMAND) && (nID>=m_nMenuPrjId) && (nID<=m_nMenuPrjId+MRU_RANGE))
{

return OpenRecentProject(nID);
}

if ((nMsg==WM_COMMAND) && (nCod==CN_COMMAND) && (nID>=m_nMenuId1) && (nID<=m_nMenuId1+MRU_RANGE))
{

return OpenEctRecentFile(nID);
}

return CWinApp::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}

CCmdUI* pCmdUI = (CCmdUI*)pExtra;
==> menu value is returned always NULL.
Is no there solvable method?



-------------
jini



Replies:
Posted By: Oleg
Date Posted: 16 August 2005 at 2:31am
See dynamic popups sample.

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


Posted By: gniwon
Date Posted: 19 August 2005 at 7:07pm

thank you ver much.

I solved this matter.



-------------
jini



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