BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
pContext=NULL;
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CFormView), CSize (220,100), pContext) ||!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFormView), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
m_wndSplitter.DeleteView(0,1); //删除右边的CSDCS_NCManagerView
m_wndSplitter.CreateView(0,1, RUNTIME_CLASS(CFormView),CSize(100,100), pContext);
//return CFrameWnd::OnCreateClient(lpcs, pContext);
return true;
// return CMDIFrameWnd::OnCreateClient(lpcs, pContext);
}
为何老是编译出错呢???是不是RUNTIME_CLASS(CFORMVIEW)不对啊.
出错信息:DEBUG ASSERTION FAILED!
{
// TODO: Add your specialized code here and/or call the base class
pContext=NULL;
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CFormView), CSize (220,100), pContext) ||!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CFormView), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
m_wndSplitter.DeleteView(0,1); //删除右边的CSDCS_NCManagerView
m_wndSplitter.CreateView(0,1, RUNTIME_CLASS(CFormView),CSize(100,100), pContext);
//return CFrameWnd::OnCreateClient(lpcs, pContext);
return true;
// return CMDIFrameWnd::OnCreateClient(lpcs, pContext);
}
为何老是编译出错呢???是不是RUNTIME_CLASS(CFORMVIEW)不对啊.
出错信息:DEBUG ASSERTION FAILED!
解决方案 »
- 音频:G.729如何支持多路同时编码或解码
- 哪位朋友有PUDN的帐号,帮我下个东西
- 如何在WinXp中打开Win98开发的Windows工程程序?
- 大家知道什么杂志发表学术论文 不要审稿费的啊? 给我介绍一下。散分了。
- 请问windows网络编程技术这本书怎么样?
- 有关TreeCtrl,向高手请教,留言者有分!
- 设计三维动画播报系统
- 100分!! 请教高手:我是用VC++编程的,请问考什么方面的认证比较有效?
- 有谁知道怎样用程序怎样登录另一台NT/2000的电脑。大家帮忙UP呀,UP有分可加哟。
- 请教:使用静态连接库出现的问题
- 求MSDN
- mfc com 中返回一个类批针接口应当定义什么类型?在线
CWaterView跟Croam分别是我这个单文档中的两个切分窗口的类!
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
CRect rect;
GetClientRect(&rect);
VERIFY(m_wndSplitter.CreateStatic(this,1,2));
VERIFY(m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CWaterView),
CSize((int)(rect.Width()*0.75), 100), pContext));
VERIFY(m_wndSplitter.CreateView( 0,1, RUNTIME_CLASS(Croam),
CSize(200, 100), pContext));
return TRUE;
}
m_wndSplitter.CreateStatic()
这个你都没有!你的m_wndSplitter.CreateView()
是用在m_wndSplitter.CreateStatic()之后,指明切分视图对应的视图的。真正的切分动作你就没有,怎么指定视图??还有,为何要把pContext=NULL;呢?
为什么调用m_wndSplitter.DeleteView(0,1)?然后再创建?想不通。
而把pContent赋值为NULL,简直是错之大矣,对此参数恐怕你根本没有了解其用法。
像老兄这样编程序,请恕我直言,要想不出错都难!
if (!m_wndSplitter.CreateStatic(this, 2, 1))
return FALSE;
(150,150),pContext);
m_wndSplitter1.CreateStatic(&m_wndSplitter,1,2,WS_CHILD|WS_VISIBLE,m_wndSplitter.IdFromRowCol(0,0));
m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CMyView),CSize(150,150),pContext);
m_wndSplitter1.CreateView(0,1,pContext->m_pNewViewClass,CSize(150,150),pContext);
m_wndSplitter1.SetRowInfo(0,150,150);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CUppView),CSize(0,0),pContext);