Print Page | Close Window

GetActiveDocumentID Event Not Firing

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=7799
Printed Date: 21 December 2024 at 10:02pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetActiveDocumentID Event Not Firing
Posted By: cradke
Subject: GetActiveDocumentID Event Not Firing
Date Posted: 14 August 2007 at 5:44pm

I am using the CommandBars ActiveX control in an MDI (non-MFC) C++ app.  The app has multiple document types that each have a different menu to be displayed when active.  The problem is that the GetActiveDocumentID event is not getting fired when a new document is added or an existing document is activated and therefore I can’t set the proper document specific menu.  

 

This is the case when either the document's window is clicked or the document's associated tab in the TabWorkspace is clicked.   The event does get called when the app closes and when the Customize dialog is closed if the Menus page has been selected.  In this second case I can successfully switch the menu from the default to one of my document menus.

 

I used the IMenuBarMDIMenus collection obtained from the ActiveMenu to add my menubars for the various document types.  These menus correctly show up in Customize dialog on Menus page.  The rest of my code was taken from the CommandBars\WTL\WTLSample project.

 

My questions for getting this show-stopper working are as follows.

Is there a way to force the GetActiveDocumentID event to be fired?

Is there an alternate way to swap the menus without losing the ability to customize them? (e.g.  GetActiveMenu()->Delete(), m_spCommandBars->AddMenu())

Could you provide a WTL MDI sample that shows this working?

 

 

Sincerely,

Christopher Radke

Applied Wave Research




Replies:
Posted By: Oleg
Date Posted: 15 August 2007 at 2:07am
Hello,
 
Please send request to mailto:support@codejock.com - support@codejock.com .


-------------
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