无法在发布模式下为COM组件创建ActiveX组件(特定于VS2010) [英] ActiveX component cannot be created for COM component in release mode (VS2010 specific)

查看:103
本文介绍了无法在发布模式下为COM组件创建ActiveX组件(特定于VS2010)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2008中有一个ATL COM组件(.exe)(VC ++)。通过VB6客户端,我使用CreateObject并获取对象。

I have an ATL COM component(.exe) (VC++ ) in VS2008. Through VB6 client, i use CreateObject and get the object.

但是一旦组件更新为VS2010 SP1,VB6客户端将不再能够创建COM对象。

But once the component is updated to VS2010 SP1, the VB6 client no longer is able to create the COM object.

如果我以调试模式编译VS2010 COM组件并获取.exe,则VB6客户端可以正常工作。
在发布模式下,生成.exe时没有任何错误,并且VB6客户端失败,提示无法创建ActiveX组件。

If I compile the VS2010 COM component in debug mode and get the .exe, VB6 client is working fine. In release mode, .exe is generated without any errors, and VB6 client fails saying ActiveX component cannot be created.

请帮助我。 / p>

Please help me in resloving this.

推荐答案

找出为什么COM拒绝创建某些CoClass实例的确是PITA。您得到的只是一些通用的错误代码,不会对您有很大帮助。如果通过Dlls使用运行时库,则应检查是否可以在调试器之外找到它们。我使用COM / OLE查看器检查是否可以创建CoClass的对象,以便可以排除问题与VB有关。

祝你好运。

Finding out why COM refuses to create an instance of some CoClass is really a PITA. All you get is some generic error code that won't help you very much. If you use the run-time library via Dlls, you should check whether those can be found outside of the debugger. I use the COM/OLE viewer to check whether I can create objects of a CoClass, so that I can rule out that the problem has anything to do with VB.

Good luck.

Stuart

这篇关于无法在发布模式下为COM组件创建ActiveX组件(特定于VS2010)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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