我用CSplitterWnd分割窗口,其中有一个窗口是FormView,有一些汉字静态文本,结果显示出来的全部是乱码,不知何故,请教各位大侠! (1)OnCreateClient函数是首次创建分割视,CCollectParaView显示乱码;
(2)OnLeftSelectedItem函数是根据消息动态重新分割,两个视都未显示汉字,并且都不执行视的InitialUpdate函数。BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
{
// TODO: Add your specialized code here and/or call the base class
if (!m_wndSplitter.CreateStatic(this,1,2))
{
return FALSE;
}
m_pContext = *pContext; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CCollectionLeftView),
CSize(100,100), pContext))
{
AfxMessageBox("1");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCollectParaView),
CSize(100,100), pContext))
{
AfxMessageBox("frame-2");
return FALSE;
}
return TRUE;
// return CFrameWnd::OnCreateClient(lpcs, pContext);
}
LRESULT CMainFrame::OnLeftSelectedItem(WPARAM wParam,LPARAM lParam)
{

// CString fileName = m_sRightUpSelectedFileName ;// MessageBox(fileName);
DWORD itemdata = (DWORD)wParam;
switch (itemdata)
{
case DATACOLLECT_PARA_CONFIG:
m_wndSplitter.DeleteView(0,1);
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCollectParaView),
CSize(100,100), &m_pContext))
{
AfxMessageBox("para-fail");
return 0;
}
// m_wndSplitter.GetPane(0,1)->SendMessage(WM_CREATE);
m_wndSplitter.RecalcLayout();
// RecalcLayout();
break ;
case TCPIP_COLLECT:
m_wndSplitter.DeleteView(0,1);
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView),
CSize(100,100), &m_pContext))
{
AfxMessageBox("right-fail");
return 0;
}
// m_wndSplitter.GetPane(0,1)->SendMessage(WM_CREATE);
m_wndSplitter.RecalcLayout();
// RecalcLayout();
break ;
default: break;
}
return 0L;
}