![]() |
CXTPStatusBar not subclassed from CStatusBar |
Post Reply ![]() |
Author | |
mrmathis ![]() Senior Member ![]() ![]() Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
![]() ![]() ![]() ![]() ![]() 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
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
mrmathis ![]() Senior Member ![]() ![]() Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
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 |