Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - How to attach a formview to a pane?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to attach a formview to a pane?

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


Joined: 03 June 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote laughrain Quote  Post ReplyReply Direct Link To This Post Topic: How to attach a formview to a pane?
    Posted: 03 June 2004 at 1:27am

How to attach a formview(drived from CFormView) to a pane in SDI?

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: 03 June 2004 at 7:59am

something like:

CFrameWnd* pFrame = new CFrameWnd;

 CCreateContext context;
 context.m_pNewViewClass = RUNTIME_CLASS(CSimpleForm);
 context.m_pCurrentDoc = GetActiveView()->GetDocument();

 pFrame->Create(NULL, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, CRect(0, 0, 0, 0), this, NULL, 0, &context);
 pFrame->ModifyStyleEx(WS_EX_CLIENTEDGE, 0);
 pFrame->SendMessageToDescendants(WM_INITIALUPDATE, 0, 0, TRUE, TRUE);

pPane->Attach(pFrame);

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
laughrain View Drop Down
Newbie
Newbie


Joined: 03 June 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote laughrain Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2004 at 1:21pm

yes, it works.   but there is a new problem(MDI)

how to get the pointer of the childframe view from the formview attached to the pane

I want to execute public function of the childframe view in a public function of the formview attached to the pane.

Have I made myself clear?  my english isn't good.

/////////////////////////////////////////////the code in formview(derived from cformview)

 CAcisViewerApp* pApp = (CAcisViewerApp*)::AfxGetApp();
 CMainFrame* pFrame = (CMainFrame*)pApp->m_pMainWnd;


  CFrameWnd* pActFrame = pFrame->GetActiveFrame();
  CAcisViewerView* pView = (CAcisViewerView*)(pActFrame->GetActiveView());

///so I must include "AcisViewerView.h" and " MainFrm.h"

but there are many errors......



Edited by laughrain
Back to Top
laughrain View Drop Down
Newbie
Newbie


Joined: 03 June 2004
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote laughrain Quote  Post ReplyReply Direct Link To This Post Posted: 05 June 2004 at 12:08am
ok,solved
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.156 seconds.