MFC ACTIVX控件无法在vb.net中使用 [英] MFC ACTIVX control can't used in vb.net

查看:83
本文介绍了MFC ACTIVX控件无法在vb.net中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

平台WIN7 64bit
VS2008

我使用Vc ++创建了MFC ACTIVEX控件的空项目,并且已正确注册.
我可以从com +列表中选择activeX并将其拖动到vb.net窗体上.但是当我运行时
没有任何自定义代码的项目,vb.net会抛出此类异常
(HRESULT:0x80040154(REGDB_E_CLASSNOTREG)).
我只想知道问题出在哪里.

PLATFORM WIN7 64bit
VS2008

I Use Vc++ create a empty project of MFC ACTIVEX control and it has been reg correctly.
I can choose the activeX from com+ list and drag it on the vb.net form.But when i run
the project without any custom code, vb.net throw a such exception
(HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)).
I just want to know where is the problem.

推荐答案

似乎您的控件未正确注册,请尝试重新安装它,注册并再试一次. />
为了进行注册,一个小的Google搜索将为您提供很多结果,我发现的第一个是: http ://www.clickteam.co.uk/resources/GTM/GTM7.htm [ ^ ]

祝你好运.
It seems your control is not properly registered, try to reinstall it, register it and try it again.

In order to register it a small google search will give you plenty of results, the first one I found is: http://www.clickteam.co.uk/resources/GTM/GTM7.htm[^]

Good luck.


好,一整夜之后,我找到了解决方法.
vb.net中的默认调试或发布平台是x64(我的PC是WIN7 64位),因此只需将调试或发布的设置更改为X86,它就可以工作.
因此排除了reg的可能性,也许修改项目配置文件就可以了.
Ok,after a long night, i find the solution.
The default debug or release platform in vb.net is x64(my Pc is WIN7 64bit),so just change the setting of debug or release to X86,it does work.
So exclude the possibility of reg,perhaps modify the project config file will do work.


我已经卸载了ocx并重新安装了很多次.
我使用工具"TSN32.exe"测试OCX文件,它确实起作用.
很有意思,ActiveX可以在MS Office下的VBA(如Word和Excel)中使用,但在vb.net中仍然不能使用.
I have uninstall and reinstall the ocx so many times.
I use the tool "TSN32.exe" to test the OCX file and it does work.
It is very interesting,the ActiveX can be used in VBA under MS Office such as Word and Excel,but it still doesn''t work in vb.net.


这篇关于MFC ACTIVX控件无法在vb.net中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆