![]() |
Need to find which MDI DocTemplate owns popup? |
Post Reply ![]() |
Author | |
MichaelN ![]() Senior Member ![]() Joined: 19 September 2006 Status: Offline Points: 112 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
MichaelN ![]() Senior Member ![]() Joined: 19 September 2006 Status: Offline Points: 112 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
Call GetCommandBars()->GetActiveDocTemplate() method instead.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |