Tech Support > Microsoft Windows > Development Resources > Splitter WIndow, how to refer to the mainframe and another peer pane from a pane??
Splitter WIndow, how to refer to the mainframe and another peer pane from a pane??
Posted by Liu Ju on October 21st, 2004


Dear friends:

I create a splitter window including two columns and 1 row.(pane 1 and pane 2)

From the class of pane 1 how can I refer to the pane 2 and the mainframe.
I did try to use the codes in the class of pane 1.
CWnd* MainFrame;
MainFrame=GetWindow(GW_OWNER);

But when I debug the MainFrame is nothing.

Plze do help!!

Thanks

Posted by Scott McPhillips [MVP] on October 21st, 2004


Liu Ju wrote:
CMainframe* pmain = (CMainFrame*)AfxGetMainWnd();
CPane2* pp2 = (CPane2*)pmain->m_splitter.GetPane(0,1);

This method of getting a pointer to pane2 is not very good practice. It
is usually recommended that you use UpdateAllViews to communicate
between views, so they will not have dependencies on each other.

--
Scott McPhillips [VC++ MVP]



Similar Posts