AttachView and connect to document |
Post Reply |
Author | |
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Posted: 27 February 2009 at 3:01am |
Hi, You can create CView in some OnCreateClient method and then attach it in OnDockingPaneNotify.
But guess its not right to connect pane to Document.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Frank_E
Newbie Joined: 26 February 2009 Location: Germany Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Hello,
I use your docking pane to display a CFormView based view. The View is attached to the pane with pPane->AttachView(this, RUNTIME_CLASS(CmyViewClass)). So far so good. The View is displayed correctly. But I want this view connected to a document. This view is not in the DocTemplate because it is not the default view. When I follow your example, the view is created and attached dynamically in OnDockingPaneNotify: LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam) { if (wParam == XTP_DPN_SHOWWINDOW) { CXTPDockingPane* pPane = (CXTPDockingPane*)lParam; if (!pPane->IsValid()) { switch (pPane->GetID()) { case IDR_PANE_myPane: { //CCreateContext does not work here, because at this point there is no document. pPane->AttachView(this, RUNTIME_CLASS(CmyView)); break; } } } return TRUE; } return FALSE; } The problem is, that at this point no document exist and I can't pass a pointer to the document and its content to AttachView together with the runtime class of my view. How can I link my dynamically created view to my document?. regards, Frank. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |