CXTPTabClientWnd::MDIGetActive |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
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 :( |
|
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 |