Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use CSplitterWnd in CFormview

Status
Not open for further replies.

victor7

Programmer
Jul 30, 2002
11
0
0
US
I want to create a split window in my CFormView window and was wondering if the approach is the same as when you do it in CFrameWnd using CSplitterWnd? As of now I am having problems and was wondering if I was on the wrong track. I'm trying to create 2 columns in the formview with the left one displaying a treeview and the right side just showing data. The problem is that I can't access the values in m_pDeviceTree and m_pDevice Tab which I have attached to the views. It keeps saying I have a sharing violation when I access their member variables. This is what I have so far. This is all put in a Create function.


if (!m_Splitter1.CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE))
return FALSE;

if (!m_Splitter1.CreateStatic( this , 1, 2,
WS_CHILD | WS_VISIBLE, m_Splitter.IdFromRowCol(1,0) ))
return FALSE;

if (!m_Splitter1.CreateView(0, 0, RUNTIME_CLASS(CDeviceTree), CSize(90,0), pContext))
return FALSE;

m_Splitter1.SetColumnInfo(0, 90, 90);

if (!m_Splitter1.CreateView(0, 1, RUNTIME_CLASS(CDeviceTab), CSize(0,0), pContext))
return FALSE;


(m_Splitter1.GetPane(0,0))->ModifyStyle( WS_THICKFRAME | WS_BORDER |WS_SIZEBOX |WS_VSCROLL |WS_HSCROLL , 0 ,SWP_SHOWWINDOW );
(m_Splitter1.GetPane(0,0))->ModifyStyleEx(WS_EX_RIGHTSCROLLBAR| WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE , 0, 1 );
(m_Splitter1.GetPane(0,1))->ModifyStyle( WS_THICKFRAME | WS_BORDER | WS_SIZEBOX |WS_VSCROLL |WS_HSCROLL , 0 ,SWP_SHOWWINDOW );
(m_Splitter1.GetPane(0,1))->ModifyStyleEx( WS_EX_RIGHTSCROLLBAR|WS_EX_CLIENTEDGE | WS_EX_WINDOWEDGE , 0, 1 );



m_Splitter1.RecalcLayout();


m_pDeviceTree = STATIC_DOWNCAST( CDeviceTree, m_Splitter1.GetPane(0,0) );

m_pDeviceTab = STATIC_DOWNCAST( CDeviceTab, m_Splitter1.GetPane(0,1) );


Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top