VisualStudio2008,MFC智能设备应用程序,添加ActiveX控件不能运行

deng_db 2010-03-08 12:34:34
用VisualStudio2008建立MFC智能设备应用程序(Visual C++语言),在对话框上添加ActiveX控件不能正常运行,显示错误如下
Debug Asserton Failed
Program:\Program files\xxx\xxx.exe
File:
f:\dd\vctools\vc7libsce\ship\atlmfc\src\mfc\occcont.cpp
Line:936
(Press Retry to debug the application)

对程序调试,错误定位到
C:\Program Files\Microsoft Visual Studio 9.0\VC\ce\atlmfc\src\mfc\occcont.cpp
指示有问题的地方在以下语句中
COleControlSiteOrWnd *pTemp =new COleControlSiteOrWnd(hwndCtrl,pOccDlgInfo->m_pItemInfo[i].bAutoRadioButton);
ASSERT(IsWindow(pTemp->m_hWnd));
...全文
272 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangruifriend 2011-02-11
  • 打赏
  • 举报
回复
注册下那个activex控件
callanzhao 2011-02-10
  • 打赏
  • 举报
回复
是没有注册那个activex控件吧。
最好拷贝到system32下,然后注册。
job82824 2010-03-08
  • 打赏
  • 举报
回复
COleControlSiteOrWnd

A group of controls begins with a control that was created with the WS_GROUP style and ends with the last control that was not created with the WS_GROUP style.

By default, the GetNextDlgGroupItem member function returns a pointer to the next control in the group. If pWndCtl identifies the first control in the group and bPrevious is TRUE, GetNextDlgGroupItem returns a pointer to the last control in the group.

-----------------------------------------------------MSDN

是获取窗口指针失败了。至于原因,我想可能是你的群组控件没有按照上述要求创建。再有就是可能是代码写错地方了--比如在对话框的构造函数里获取控件的句柄之类的肯定会失败,因为这时候对话框尚未创建,更不用说控件了。
deng_db 2010-03-08
  • 打赏
  • 举报
回复
只是添加ActiveX控件才会出错,其他的控件可以正常运行,当我把添加的ActiveX控件删除程序就能运行,真不知道该怎样做才能正常使用ActiveX控件。

7,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧