我想一个窗口里实现分割窗口的功能,但这个窗口不是从CFrameWnd继承过来,而是由CWnd继承而来的,
我在这个窗口里声明了成员:
CSplitterWnd m_wndSplitter1, m_wndSplitter2;
CWnd *pWnd1, *pWnd2;
在CWorkSpaceAssistDiagnoses::OnCreate(LPCREATESTRUCT lpCreateStruct)里有:
BOOL A = m_wndSplitter1.CreateStatic(this,1,2,WS_CHILD|WS_VISIBLE);
CCreateContext context;
context.m_pCurrentFrame = (CFrameWnd*)this;
context.m_pNewViewClass = RUNTIME_CLASS(CDiseaseInfoWnd);
BOOL b = m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CDiseaseInfoWnd), CSize(0, 0), &context);
BOOL C = m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CDiseaseInfoWnd), CSize(0, 0), &context);
pWnd1 = m_wndSplitter1.GetPane(0, 0);
pWnd2 = m_wndSplitter1.GetPane(0, 1);
因为这个窗口是从另一个窗口里创建里创建的,在调用Create的时候,指定的Size为0,0,所以这里也指定为0;
但是创建后什么也看不到
于是我在void CWorkSpaceAssistDiagnoses::OnSize(UINT nType, int cx, int cy) 里加入了如下代码: 
CWnd::OnSize(nType, cx, cy); CRect rect,rect2;
GetClientRect(&rect);
m_wndSplitter1.GetWindowRect(&rect2);
if(pWnd1 != NULL)
{
m_wndSplitter1.MoveWindow(rect.Width()/2,0,(rect.Width()-rect2.Width())/2,rect.Height());
pWnd1->MoveWindow(0,0,rect.Width()/2,rect.Height());
pWnd2->MoveWindow(rect.Width()/2,0,rect.Width()/2, rect.Height());
}
但是只是显示了右边的窗口,而左边的窗口没有显示,而且我发现OnSize的最后两句没有用,去掉了还是那个效果,怎么才能把左边的窗口也显示出来呢