Print Page | Close Window

CXTPStatusBar not subclassed from CStatusBar

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


Topic: CXTPStatusBar not subclassed from CStatusBar
Posted By: mrmathis
Subject: CXTPStatusBar not subclassed from CStatusBar
Date Posted: 19 September 2007 at 11:02am
I am working with a large existing application, making use of Codejock in various places.  In a few places, I would like to replace CStatusBar usage with CXTPStatusBar to take advantage of its extended capabilities.  I assumed that the XTP control would derive from the MFC control, and that I could change the single internal API I have to obtain the status bar control to cast the CXTPStatusBar to a CStatusBar, and that most places in my code base could continue to function just fine through the CStatusBar interface without any editing on my part.  However, that fell apart once I realized that CXTPStatusBar doesn't derive from CStatusBar.

Is there any way to handle this without massive edits to my code base?

--Mike



-------------
--Mike



Replies:
Posted By: Oleg
Date Posted: 19 September 2007 at 1:58pm
Hello,
 
Yes, CXTPStatusBar is not derived from CStatusBar, but it has all same methods.  Just replace CStatusBar to CXTPStatusBar, think it will work without any changes.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: mrmathis
Date Posted: 19 September 2007 at 2:51pm
It doesn't have the exact same methods.  CXTPStatusBar::SetPaneText asks for a CString& rather than LPCTSTR.  The proprietary object I use for most of my text handling can automatically cast to LPCTSTR.  To get CString& I will have to edit code.

Also, if (OK, when) I replace CStatusBar with CXTPStatusBar, I will need to change every pointer declaration that deals with CStatusBar and make the change there, too.  That's a bummer, and I'm wondering why you didn't just subclass CStatusBar and avoid that kind of issue.



-------------
--Mike



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