OCX下cframewnd做子窗口,怎样将CDocument与CView事件联系起来 如题,给个最简单的例子就好 我好几个帖子一样的帖子 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我ctrl下初始化CFrameWnd的代码int CSanCeDanCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct){if (COleControl::OnCreate(lpCreateStruct) == -1)return -1;// TODO: Add your specialized creation code herem_ptrMainFrame = new CMainFrame;m_ptrMainFrame->Create(NULL,NULL,WS_CHILD,CRect(0,0,1280,768), this);m_ptrMainFrame->ShowWindow(TRUE);m_ptrMainFrame->UpdateWindow();return 0;}以下是我CFrameWnd创建的代码BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) {// TODO: Add your specialized code here and/or call the base classm_ptrDoc = new CCellDoc();m_ptrView = new CCellView();m_ptrView->Create(NULL, NULL, WS_CHILD|WS_VISIBLE,CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST, NULL);m_ptrDoc->AddView(m_ptrView);m_ptrView->SetDocument(m_ptrDoc);CWnd* _tmp = this;m_ptrView->SetMainFramePtr(_tmp);m_ptrView->ShowWindow(TRUE);m_ptrView->UpdateWindow();int retValue = TRUE;retValue = Fx_CreateToolBar();m_wndToolBar.ShowWindow(SW_SHOW);m_wndStatusBar.ShowWindow(SW_SHOW);m_wndToolBarTextTool.ShowWindow(SW_SHOW);SetActiveView(m_ptrView);return TRUE;}能不能告诉我一下哪里有问题是不是在创建过程中就有了问题。谢谢大侠了~ 问题又有了新的进展,发现CFrameWnd的菜单有点击事件 但是没有鼠标移动状态改变事件,区别是因为将view显示了出来 所以CFrameWnd的事件有些就不能处理,没用单文档类我该怎样做CFrameWnd和CView的事件? 没做过SDI,不太清楚里面的消息驱动流程,有个建议就是你新建一个SDI工程,看看里面的区别,OCX和普通的MFC程序就是新建最外层窗口的地方有点不一样,其他的都被MFC隐藏起来了,你就当作普通程序看待就行了,除了一些特殊的按键处理会被浏览器拦截,什么鼠标,普通键盘输入都是没问题的. 事件一般都不用自己处理,你描述的只要不显示View就没问题 你可以根据view绘制一级一级注释看能不能有所突破 skin++加载问题 关于lib和dll的问题(静态连接和动态连接) 使用installshield制作安装程序 新人报道,顺便问个问题 关于早绑定COM接口VTBL的一个问题 目的:在每一次调用某全局函数时设置CDC的一部分像素,完成全局函数调用循环后显示CDC的结果!我是这么做的...但是运行第一次是正常的, 急!!急!!急!!哪位大虾知道《VC6.0编程实例与技巧》的电子版下载,机工的,谢了!! 为什么QQ企业邮箱发送失败 如何让应用程序停止 MFC 文件互相包涵 新手求助 vc++ 基于对话框的图像处理怎么做? 关于ACTIVEX下事件问题
int CSanCeDanCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleControl::OnCreate(lpCreateStruct) == -1)
return -1;// TODO: Add your specialized creation code here
m_ptrMainFrame = new CMainFrame;
m_ptrMainFrame->Create(NULL,NULL,WS_CHILD,CRect(0,0,1280,768), this);m_ptrMainFrame->ShowWindow(TRUE);
m_ptrMainFrame->UpdateWindow();return 0;
}以下是我CFrameWnd创建的代码
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base classm_ptrDoc = new CCellDoc();
m_ptrView = new CCellView();
m_ptrView->Create(NULL, NULL, WS_CHILD|WS_VISIBLE,CRect(0,0,0,0), this, AFX_IDW_PANE_FIRST, NULL);
m_ptrDoc->AddView(m_ptrView);
m_ptrView->SetDocument(m_ptrDoc);
CWnd* _tmp = this;
m_ptrView->SetMainFramePtr(_tmp);
m_ptrView->ShowWindow(TRUE);
m_ptrView->UpdateWindow();int retValue = TRUE;
retValue = Fx_CreateToolBar();m_wndToolBar.ShowWindow(SW_SHOW);
m_wndStatusBar.ShowWindow(SW_SHOW);
m_wndToolBarTextTool.ShowWindow(SW_SHOW);SetActiveView(m_ptrView);return TRUE;
}能不能告诉我一下哪里有问题是不是在创建过程中就有了问题。谢谢大侠了~