Print Page | Close Window

CXTPTabClientWnd::MDIGetActive

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=22408
Printed Date: 28 November 2024 at 9:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabClientWnd::MDIGetActive
Posted By: rdhd
Subject: CXTPTabClientWnd::MDIGetActive
Date 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 :(



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