SPLITTER高手请进!!!急!!!!!!

hainanb 2005-08-19 03:33:23
代码如下:
BOOL CRTSSCORELogFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
BOOL ret;

CRect rect;
GetClientRect(&rect);
int Cx = rect.Width();
int Cy = rect.Height();
ret = m_wndSplitter.CreateStatic (this, 2, 1, WS_CHILD|WS_VISIBLE);
if (ret)
{

ret = m_wndSplitterMonitor.CreateStatic(&m_wndSplitter, 1, 2, WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol(0, 0));
if (ret)
{

ret = m_wndSplitterMonitor.CreateView(0, 0, RUNTIME_CLASS(CRTSSCORELogMonitorView), CSize((Cx*6)/11, 0), pContext);
ret = m_wndSplitterMonitor.CreateView(0, 1, RUNTIME_CLASS(CRTSSCORELogListView), CSize(0, 0), pContext);


if (ret)
{
//让窗口重新布局
m_pMonitorView = (CRTSSCORELogMonitorView *)m_wndSplitterMonitor.GetPane(0, 0);

SetActiveView(m_pMonitorView);
m_pListView = (CRTSSCORELogListView *)m_wndSplitterMonitor.GetPane (0, 1);

m_wndSplitter.SetRowInfo(0, 380, 80);
m_wndSplitterMonitor.SetColumnInfo(0, 557, 60);
m_wndSplitterMonitor.RecalcLayout();

ret = m_wndSplitter2.CreateStatic (&m_wndSplitter, 1, 2, WS_CHILD|WS_VISIBLE, m_wndSplitter.IdFromRowCol (1, 0));
if (ret)
{
ret = m_wndSplitter2.CreateView(0, 0, RUNTIME_CLASS(CRTSSCORELogEditView), CSize(0, 0), pContext);
ret = m_wndSplitter2.CreateView(0, 1, RUNTIME_CLASS(CRTSSCORELogTraceView), CSize(0, 0), pContext);

}
if (ret)
{
m_pEditView = (CRTSSCORELogEditView *)m_wndSplitter2.GetPane (0, 0);
m_pEditView->m_pListView = m_pListView;
m_pTraceView = (CRTSSCORELogTraceView *)m_wndSplitter2.GetPane (0, 1);
m_pTraceView->m_pListView = m_pListView;
m_pListView->m_pEditView = m_pEditView;
m_pListView->m_pTraceView = m_pTraceView;
m_pListView->m_pMonitorView=m_pMonitorView;

//让窗口重新布局

m_wndSplitter2.SetColumnInfo(0, 557, 55);
m_wndSplitter2.RecalcLayout ();
}
// m_wndSplitter.SetRowInfo(0, 380, 80);
}
}
}
return ret;
}
使用过程中出现下列异常:Debug Assertion Failed!
File:winsplit.cpp
line:1980
请各位大虾指教!!!
...全文
208 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
你的代码没有问题,只是放的位置不对,应该放在ChildFrame的OnCreateClient中而不是MainFrame中
回复
hainanb 2005-08-22
需要说明一下是,我想分割窗口为2行2列。采用的是静态分割。出现的异常,不知道是否是分隔窗体时造成的。
回复
发帖
界面
创建于2007-09-28

1.5w+

社区成员

VC/MFC 界面
申请成为版主
帖子事件
创建了帖子
2005-08-19 03:33
社区公告
暂无公告