Print Page | Close Window

GetMenu won't work

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=19229
Printed Date: 05 October 2024 at 9:31pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetMenu won't work
Posted By: dehilster
Subject: GetMenu won't work
Date Posted: 27 November 2011 at 12:08pm
I have added a dummy menu item to implement a recent analyzers submenu.  I use the recent files which is automatic and that is kewl.

I need to implement a similar submenu but with our own recent list.

I have done the following:

ON_UPDATE_COMMAND_UI(ID_FILE_RECENTANALYZERS, OnUpdateFileRecentanalyzers)

Where ID_FILE_RECENTANALYZERS is an id in a submenu I want to modify.  I have the modification code but the problem is, I can't get the menu with GetMenu so that it modifies the actual menu.

Here is the other code:

void CMainFrame::OnUpdateFileRecentanalyzers(CCmdUI *pCmdUI)
{
CMenu *menu = GetMenu();
// menu is null here
RecentAnalyzerMenu();
}

I am using CXTPMDIFrameWnd instead of CMDIFrameWnd.  When I create a separate test project in Visual Studio 2008 with CMDIFrameWnd, GetMenu returns the menu.

How do I get the hand to the actual menu if GetMenu is return null with code jocks code?



-------------
David de Hilster



Replies:
Posted By: dehilster
Date Posted: 27 December 2011 at 11:52am
Wow, no one answers.  Are are there any CodeJock techs here to answer questions?

-------------
David de Hilster



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