Print Page | Close Window

Need to find which MDI DocTemplate owns popup?

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=6138
Printed Date: 04 October 2024 at 9:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Need to find which MDI DocTemplate owns popup?
Posted By: MichaelN
Subject: Need to find which MDI DocTemplate owns popup?
Date Posted: 16 January 2007 at 5:43pm
I have an MDI app with multiple Doc Templates. I need to know which Doc Template owns the popup, from inside CMainFrame::OnInitCommandsPopup().
 
I can't get to CXTPCommandBar::GetActiveDocTemplate() because it is protected, but that sounds like what I need. Is there any other way to determine which doc template owns the popup from within the MainFrame handler?
 
Thanks,
 
Michael



Replies:
Posted By: MichaelN
Date Posted: 16 January 2007 at 6:00pm
Well, I solved it, but the method seems a little "over the top", if there is a simpler way.
 
I derived a spoof class from CXTPControlBar which uses the CXTPCommandBar::Copy(0 method and has a public method that returns the value of the protected CXTPCommandBar::GetActiveDocTemplate().
 
Inside CMainFrame::OnInitCommandsPopup(). I create an instance of my spoof class and pass it pCommandBar, then call get the DocTemplate from it.
 
Is there a simpler way?
 
Michael


Posted By: Oleg
Date Posted: 17 January 2007 at 12:56am
Hello,
 
Call GetCommandBars()->GetActiveDocTemplate() method instead.


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