ActiveX component cannot be created for COM component in release mode (VS2010 specific)

蓝咒 提交于 2019-12-25 06:31:30

问题


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

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

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.

Please help me in resloving this.


回答1:


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



来源:https://stackoverflow.com/questions/14192862/activex-component-cannot-be-created-for-com-component-in-release-mode-vs2010-sp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!