Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - CXTPTabClientWnd::MDIGetActive
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabClientWnd::MDIGetActive

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

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabClientWnd::MDIGetActive
    Posted: 10 September 2014 at 8:34am
It would be very nice if CXTPTabClientWnd::MDIGetActive was a virtual method.

I could not use UpdateContents as is because MDIGetActive calls MFC and the MFC function will only return a permanent window for the active document if the window is derived from CMDIChildWnd. UpdateContents is virtual but the code accesses member variables of other structs/classes that friend CXTPTabClientWnd and those variables have no accessor methods. Hence just overriding UpdateContents is not much of an option.

If one doesn't implement the MFC MDI archetecture but can still return a CWnd from MDIGetActive, then making MDIGetActive virtual is a very simple way to accommodate applications that don't use the MFC MDI classes. MDI is not a MFC technology and not every app that uses MFC uses the MFC implementation of the MDI.

This practice of creating virtual methods that directly access member data of other classes by relying on the "friend" construct is not optimal. If one cannot just call the base class and then add value but instead needs to tweak the original code this makes the task nearly impossible :(
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.188 seconds.