我用vs2010建立了一个ribbon工程,然后里面嵌入一个对话框,建立对话框类的时候我用的基类是Cformview,类向导会提示是否 生成 DocTemplate 资源(G) ,我选择了,最后运行程序的时候会出现一个新建提示对话框,要我选择是工程还那是那个对话框,
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//ODO: 在此添加专用代码和/或调用基类
CRect rtMainFrame(0, 0, 0, 0);
this->GetClientRect(&rtMainFrame);
CRuntimeClass* pEmiViewClass = NULL;
pEmiViewClass = RUNTIME_CLASS(CRibbon1View);
CCreateContext context;
context.m_pNewViewClass = pEmiViewClass;
context.m_pCurrentDoc = GetActiveDocument();
CView* pNewView = NULL;
pNewView = STATIC_DOWNCAST(CView, CreateView(&context));
if (pNewView != NULL)
{
// the new view is there, but invisible and not active...
pNewView->ShowWindow(SW_SHOW);
pNewView->OnInitialUpdate();
SetActiveView(pNewView);
RecalcLayout();
}
else
{
return FALSE;
}
m_pTCView = (CRibbon1View*)pNewView;
//m_pTCView->m_pMainFrame = this;
m_pTCView->CreateTestModeView();
//CreateReportTemplateFolder(_T(""));
return TRUE; return CFrameWndEx::OnCreateClient(lpcs, pContext);
}
还有就是 我用OnCreateClient为什么会崩溃啊
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
//ODO: 在此添加专用代码和/或调用基类
CRect rtMainFrame(0, 0, 0, 0);
this->GetClientRect(&rtMainFrame);
CRuntimeClass* pEmiViewClass = NULL;
pEmiViewClass = RUNTIME_CLASS(CRibbon1View);
CCreateContext context;
context.m_pNewViewClass = pEmiViewClass;
context.m_pCurrentDoc = GetActiveDocument();
CView* pNewView = NULL;
pNewView = STATIC_DOWNCAST(CView, CreateView(&context));
if (pNewView != NULL)
{
// the new view is there, but invisible and not active...
pNewView->ShowWindow(SW_SHOW);
pNewView->OnInitialUpdate();
SetActiveView(pNewView);
RecalcLayout();
}
else
{
return FALSE;
}
m_pTCView = (CRibbon1View*)pNewView;
//m_pTCView->m_pMainFrame = this;
m_pTCView->CreateTestModeView();
//CreateReportTemplateFolder(_T(""));
return TRUE; return CFrameWndEx::OnCreateClient(lpcs, pContext);
}
还有就是 我用OnCreateClient为什么会崩溃啊
解决方案 »
- 动态的添加文件中的bmp文件到程序资源中,而且可以获得资源ID
- CSocket 疑问 ?局域网通信
- 托盘程序的冒泡通知怎么实现?
- _open打开的文件句柄能给windows API用吗?
- 您的程序需要加壳吗?请联系我
- 如何改变屏幕的刷新率
- 高手:关于如何截获 CSpinButtonCtrl 的上下箭头消息
- DirectShow,为什么 Win7 中ISampleGrabberCB连接 Xvid 会出错,XP却不会出错?
- 如何取Check Box, ComboBox的值?
- VC编程,如何防止一个程序的多个实例同时运行。
- 侯捷 深入浅出MFC 11章中Scribble程序 为什么不能实现拆分功能啊
- vs2010 OnCreateClient文档视图问题
我是本版版主
此帖已多日无人关注
请您及时结帖
如您认为问题没有解决可按无满意结帖处理
另外本版设置了疑难问题汇总帖
并已在版面置顶
相关规定其帖子中有说明
您可以根据规定提交您帖子的链接
如您目前不想结帖只需回帖说明
我们会删除此结帖通知见此回复三日内无回应
我们将强制结帖
相关规定详见界面界面版关于版主结帖工作的具体办法