These program creates splitter windows using CSplitterWnd class, but the problem is that the views fills the entire desktop rather that the parent frame windows. Each pane is of type CformView. Please what am I dong wrong.
Noe that the frme wnd I am trying to split is not that main window, it is a child of the main window. It is being created using CWnd::Create function
BOOL MyFrameWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_pWnd = NULL;
m_pParent = this;
if(!m_Splitter.CreateStatic(this,2,1,WS_CHILD))
{
return FALSE;
}
SIZE top, bottom;
CRect rect;
GetClientRect(&rect);
top.cx = rect.right;
top.cy = 2 * (rect.bottom - m_Splitter.GetHeight()) / 10;
bottom.cx = rect.right;
bottom.cy = 8 * (rect.bottom - m_Splitter.GetHeight()) /10;
m_Splitter.CreateView(0,0,RUNTIME_CLASS(StudRegTop),top,pContext);
m_Splitter.CreateView(1,0,RUNTIME_CLASS(StudRegBottom),bottom,pContext);
SetActiveView((CView *)m_Splitter.GetPane(0,0));
m_Splitter.ShowWindow(SW_NORMAL);
m_Splitter.UpdateWindow();
return CFrameWndEx::OnCreateClient(lpcs, pContext);
}