Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPStatusBar not subclassed from CStatusBar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPStatusBar not subclassed from CStatusBar

 Post Reply Post Reply
Author
Message
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Topic: CXTPStatusBar not subclassed from CStatusBar
    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
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post 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
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.043 seconds.