![]() |
How to access control on Pane1 from Pane2 |
Post Reply ![]() |
Author | ||
AdrianM ![]() Newbie ![]() Joined: 08 August 2003 Location: United States Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() Posted: 06 July 2004 at 7:42pm |
|
I'm trying to access tree control data on inactive Pane2, from active Pane1. Both are CFormView panes in an SDI app. Pane 2 is also attached to Pane 1 so it gives a tab box effect. Any suggestions on how to do this? Thanks, - Adrian Edited by AdrianM |
||
![]() |
||
kstowell ![]() Admin Group ![]() Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
![]() ![]() ![]() ![]() ![]() |
|
Hello, Assuming that you have a CTreeCtrl member of your CFormView class as show below:
You could do the following:
Hope this helps... Kind Regards, Codejock Support |
||
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
||
![]() |
||
AdrianM ![]() Newbie ![]() Joined: 08 August 2003 Location: United States Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
|
Thank you. My m_paneManager is actually in my MainFrame. So I modified the code to add CMainFrame in order to access m_paneManager...
CMainFrame* mf = (CMainFrame*)AfxGetMainWnd(); CMyFormView1* pFormView = DYNAMIC_DOWNCAST(CMyFormView1, pPane->GetChild()); CTreeCtrl& treeCtrl = pFormView->GetTreeCtrl(); } It looks like its close to working.. but the only thing that is not working now is that pFormView is FALSE so the IF statement doesn't execute. Did I call CMainFrame incorrectly?
|
||
![]() |
||
kstowell ![]() Admin Group ![]() Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
![]() ![]() ![]() ![]() ![]() |
|
Is is possible that your CFormView is nested in a CFrameWnd? If so that would explain why DYNAMIC_DOWNCAST is returning NULL. Please try this:
hope this helps... |
||
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
||
![]() |
||
AdrianM ![]() Newbie ![]() Joined: 08 August 2003 Location: United States Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
|
Hello, This code asserts at: ASSERT_VALID(pChildWnd); I appreciate your help. Best wishes, - Adrian |
||
![]() |
||
kstowell ![]() Admin Group ![]() Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
![]() ![]() ![]() ![]() ![]() |
|
Make sure you make the call AFTER you have attached the view to the pane.
|
||
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
||
![]() |
||
AdrianM ![]() Newbie ![]() Joined: 08 August 2003 Location: United States Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
|
The call to ASSERT_VALID (pChildWnd) is made after the call to create the pane. - Adrian |
||
![]() |
||
kstowell ![]() Admin Group ![]() Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
![]() ![]() ![]() ![]() ![]() |
|
And after your "Attach" or "AttachView" ? If you try to call this before you attach the view, pChildWnd will be NULL. If yes, then please upload a sample project so I can debug the problem, thanks.
|
||
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
||
![]() |
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 |