Print Page | Close Window

Document access from CXTPFrameWnd in SDI

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
Printed Date: 16 May 2022 at 5:02pm
Software Version: Web Wiz Forums 12.04 -

Topic: Document access from CXTPFrameWnd in SDI
Posted By: VAGB
Subject: Document access from CXTPFrameWnd in SDI
Date Posted: 23 November 2004 at 12:44pm


Here is my question:

When you are using the CXTPFrameWnd class as the base class from which CMainFrame is derived in a SDI application, is the access to the document class lost? I mean, Ive noticed there is no longer GetActiveDocument() function available. With CXTPMDIFrameWnd everything works fine, but I need a SDI application instead of a MDI one. I have data stored in the CDocument class and I need to access to that data from the MainFrame, but as Ive derived this from CXTPFrameWnd in order to use Docking Panes on it, I have lost all the functions provided by CFrameWnd.

I hope you are so kind to help me, thanks.

Posted By: Oleg
Date Posted: 23 November 2004 at 11:44pm

Give me your non-working piece of code.

I added

CDocument* pDocument = GetActiveDocument(); in void CMainFrame::OnCustomize()

of GUI_ACDSee sample and it works.


Check may be you have

class CMainFrame : CXTPFrameWnd

instead of

class CMainFrame : public CXTPFrameWnd


Oleg, Support Team

Posted By: VAGB
Date Posted: 16 December 2004 at 12:24pm

Thank you very much!

Indeed the problem was derived from a bad interpretation of the code. As CXTPFrameWnd derives from CXTPFrameWndBase as a template Visual C++ does not show the GetActiveDocument() function on its help devices, but if you use it... well, there it is.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 -
Copyright ©2001-2021 Web Wiz Ltd. -