Print Page | Close Window

Using a modified CXTPCommandBars class

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=5297
Printed Date: 04 March 2025 at 7:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Using a modified CXTPCommandBars class
Posted By: robin_l
Subject: Using a modified CXTPCommandBars class
Date 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?



Replies:
Posted By: robin_l
Date 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....



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