Print Page | Close Window

How to attach a formview to a pane?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=805
Printed Date: 27 April 2024 at 8:16pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to attach a formview to a pane?
Posted By: laughrain
Subject: How to attach a formview to a pane?
Date Posted: 03 June 2004 at 1:27am

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

thanks!




Replies:
Posted By: Oleg
Date 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


Posted By: laughrain
Date 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......



Posted By: laughrain
Date Posted: 05 June 2004 at 12:08am
ok,solved



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