首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

分割窗体时的异常

2014-05-30 
分割窗体时的错误BOOLCMainFrame::OnCreateClient(LPCREATESTRUCTlpcs,CCreateContext*pContext){//TODO:A

分割窗体时的错误
BOOL   CMainFrame::OnCreateClient(LPCREATESTRUCT   lpcs,   CCreateContext*   pContext)  
{
//   TODO:   Add   your   specialized   code   here   and/or   call   the   base   class

                  if(!m_wndSplitter1.CreateStatic(this,1,2))
                          retern   FALSE;

return   TRUE;
//return   CFrameWnd::OnCreateClient(lpcs,   pContext);
}
编译时通过,运行时提示错误
Debug   Assertion   Failed!
file:winsplit.cpp
line:364
为什么????

[解决办法]
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class

if(!m_wndSplitter1.CreateStatic(this,1,2))
retern FALSE;

m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CYourView), CSize(100,100), pContext);

return TRUE;
// return CFrameWnd::OnCreateClient(lpcs, pContext);
}
[解决办法]
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class

if(!m_wndSplitter1.CreateStatic(this,1,2))
retern FALSE;

m_wndSplitter1.CreateView(0, 0, RUNTIME_CLASS(CYourView1), CSize(100,100), pContext);
m_wndSplitter1.CreateView(0, 1, RUNTIME_CLASS(CYourView2), CSize(100,100), pContext);

return TRUE;
// return CFrameWnd::OnCreateClient(lpcs, pContext);
}

热点排行