CSplitterWnd中使用CFormView的问题

bitxinhai bitxinhai 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
制作一个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;
}

请高手指点啊????非常谢谢!!!
...全文
评论 1
收藏 已收藏
分享
返回顶部
bitxinhai
VC/MFC 16,550 成员 421,606 内容