tags:

views:

152

answers:

3

I am getting the following error on my workstation when I am trying to work with a COM object.

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in CarteGraphInterface.exe

Additional information: Retrieving the COM class factory for component with CLSID {3963F0F8-6B0C-4A65-90F4-F60168044014} failed due to the following error: 80040154.

I have read through a few questions here on SO and non of them have helped. That ID is not listed anywhere in the registry. Does it need to be added?

Update: A bit more information. When I choose "Add Reference..." in VS2008, the object is listed there (that is how I found it initially), and the source is listed as a *.exe. regsrv32 didn't work.

+2  A: 

Hi there.

It might be that you need to register the COM DLL using

regsvr32.exe /i dllname

Try that first perhaps and see if that makes a difference.

EDIT: Don't know if you use this, but COM Explorer might be able to help you too. Try the trial version to if it helps you with this problem.

EDIT: I've been trying to find out more about the error code, and the best I could find is this, which clarifies that it must be the DLL which is not registred.

Cheers. Jas.

Jason Evans
A: 

How did you add reference to your project? When working with COM you almost always should add reference at "COM" tab (not at "Browse"), this ensures you will get a valid reference to a registered object, creating a new interop assembly. Though, if you have a registration problem, you most probably won't find required reference on COM tab.

First, it's very strange for a COM component to live in an executable file (though it's possible). Maybe this component wasn't supposed to be instantiated from another application, so all registration data had been removed? I would suggest contacting whomever you got this component from and ask for a registerable dll version.

Chriso
It's an application I am trying to interface with. They have an "undocumented" API. I know they have one because they can "write custom programs" to do "whatever we want." I thought I would give it a shot to see if those COM objects I found could be used. The object browser shows exactly what I was looking for and started to interface with it. Could it be that it requires VB vs. C# or would the same result show up?
Mike Wills
A: 

None of these solutions worked. I assume that they do not actually have APIs that could be used with .NET (if at all).

Mike Wills