Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Document access from CXTPFrameWnd in SDI
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Document access from CXTPFrameWnd in SDI

 Post Reply Post Reply
Author
Message
VAGB View Drop Down
Newbie
Newbie


Joined: 23 November 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote VAGB Quote  Post ReplyReply Direct Link To This Post Topic: Document access from CXTPFrameWnd in SDI
    Posted: 23 November 2004 at 12:44pm

Hello!:

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, I´ve 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 I´ve 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.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
VAGB View Drop Down
Newbie
Newbie


Joined: 23 November 2004
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote VAGB Quote  Post ReplyReply Direct Link To This Post 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.

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.125 seconds.