UrK

Hello.
I am building COM library in VS2005 SP1. The development is done on Vista machine.
The module and my example project worked fine.
Than the project was transferred as-is to a different machine with XP installed (the same VS2005 with SP1). Here the COM object cannot be instantiated from the example project. The error returned by CoCreateInstance() is 0x80004002: no such interface supported.

Would appreciate any help.


Re: Visual C++ General ATL-COM: 80004002 when moving the project between machines

Ted.

I suspect some dependencies are missing, and/or you haven't registered the COM object on the new machine.

I assume you are building with _ATL_STATIC_REGISTRY preprocessor define.





Re: Visual C++ General ATL-COM: 80004002 when moving the project between machines

UrK

As I see it, Visual Studio registers COM object after compilation. Anyways, removing it and re-registering manually, does not solve the problem.
_ATL_STATIC_REGISTRY has no effect on this problem.




Re: Visual C++ General ATL-COM: 80004002 when moving the project between machines

Ted.

Here's another thought. Where you derive from IDispatchImpl can you specify your type library version explicitly in the last two parameters (4th and 5th parameters representing the major and minor version of the type library in your IDL) . This solved the same error for me a while ago, so it's worth a try.



Re: Visual C++ General ATL-COM: 80004002 when moving the project between machines

UrK

The object in question does not derive from IDispatchImpl.
To tell you the truth, with my level of expertise, I don't event know what this means (dual interface ).
As for now this object is used only from C++, so it does not need any.




Re: Visual C++ General ATL-COM: 80004002 when moving the project between machines

UrK

Solved the problem by changing apartment from "Free" to "Both"