创建一个标准的SDI工程,重载OnCreateClient,如下:
BOOL CDBViewFrm::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
m_wndSplitter.CreateStatic(this, 1, 2);
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CDBView), CSize(100, 100), pContext);
return TRUE;
}为什么每次运行都崩溃???? 好郁闷啊!!!!!
BOOL CDBViewFrm::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
{
m_wndSplitter.CreateStatic(this, 1, 2);
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CDBView), CSize(100, 100), pContext);
return TRUE;
}为什么每次运行都崩溃???? 好郁闷啊!!!!!
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CDBView), CSize(100, 100), pContext);
m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CDBView1), CSize(100, 100), pContext);
2、重载:BOOL CMainFrame::OnCreateClient
3、新建对话框资源,属性改为 child,none;
4、为对话框资源新建类,CTestView1 Public: CFormView;
5、加入相应的头文件;
6、加入:
if(m_wndSplitter.CreateStatic(this,1,2)==NULL)
return FALSE;
m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTestView),CSize(250,100), pContext); m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CTestView1),CSize(100,100),pContext);
return TRUE;
7、屏蔽所有出现的错误