CSplitterWnd中使用CFormView的问题
制作一个SDI程序,要分割为左右两列,第一列为普通的视图,第二列为CFormView继承过来的对话框,对话框中有些按钮,
为什么普通的视图可以创建成功,而CFormView继承过来的对话框就老是创建失败呢???
代码大概如下:
1、CFormView继承过来的对话框CTestDlg
#ifndef __AFXEXT_H__
#include <afxext.h>
#endif
class CTestDlg : public CFormView
{
protected:
CTestDlg(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CTestDlg)
.......
2、切分视图代码段
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
if (!m_split.CreateStatic(this, 1, 2)) return false;
if (!m_split.CreateView(0, 0, pContext->m_pNewViewClass,
CSize(750, 100), pContext))
return false;
if (!m_split.CreateView(0, 1, RUNTIME_CLASS(CTestDlg),
CSize(300, 100), pContext))
return false;
ShowWindow(3);
return true;
}
请高手指点啊????非常谢谢!!!