Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Using a modified CXTPCommandBars class
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Using a modified CXTPCommandBars class

 Post Reply Post Reply
Author
Message
robin_l View Drop Down
Senior Member
Senior Member


Joined: 15 October 2006
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote robin_l Quote  Post ReplyReply Direct Link To This Post Topic: Using a modified CXTPCommandBars class
    Posted: 15 October 2006 at 6:56pm

I need to use a modified CXTPCommandBars class so it would seem appropriate to use a class derived from CXTPMDIFrameWnd (mine is an MDI app) and override InitCommandBars to allow the m_pCommandBars member to be created based on the modified class.

 

In principle I’d like to do the following:

 
Quote
BOOL CMyXTPMDIFrameWnd::InitCommandBars(CRuntimeClass* pCommandBarsClass)

{

      ASSERT(pCommandBarsClass->IsDerivedFrom(RUNTIME_CLASS(CModifiedXTPCommandBars)));

      m_pCommandBars =  (CModifiedXTPCommandBars *) pCommandBarsClass->CreateObject();

      ASSERT(m_pCommandBars);

      m_pCommandBars->SetSite(this);

      m_pCommandBars->EnableDocking();

      return TRUE;

}

 
Unfortunately, m_pCommandBars is declared private, so this code is not allowed. How can I achieve this?
Back to Top
robin_l View Drop Down
Senior Member
Senior Member


Joined: 15 October 2006
Status: Offline
Points: 117
Post Options Post Options   Thanks (0) Thanks(0)   Quote robin_l Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2006 at 8:37pm
DOH....
 
All I needed to do was use the extended form of InitCommandBars
 
Quote
if (!InitCommandBars(RUNTIME_CLASS(CModifiedXTPCommandBars)))
     return -1;
 
Easy when you know how....
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.109 seconds.