tags:

views:

269

answers:

2

Hi All, I am getting following problem, can someone help please? I used Tlbimp utility and converted VB6 COM DLL into RCW DLL. From my Visual Studio 2008, I used "Add Reference" and used that DLL in c# class. Everything works fine on my machine. But if someone else use the same project on his/her machine then on that machine they get following error: "Retrieving the COM class factory for component with CLSID {x} failed due to the following error 80040154". I tried to search for that CLSID GUID on that machine but couldn't find under HKCR/CLSID location.

Does anyone has clue/idea why its giving problem on different machine and what I can try to resolve this problem?

Thanks.

+3  A: 

You need to install the COM object on the other machine surely? The error getting returned means the class isn't registered. tlbimp just creates a wrapper assembly to map the COM interface into .NET, it does not convert the COM object itself and does not carry it with it.

Take the VB6 COM object DLL (or .OCX), put it on the other machine and run regsvr32 object.ocx and it should now work.

tyranid
+1 Although if there is an install for the VB6 COM DLL you should just run the install, rather than use regsvr32. There may be other dependencies required.
MarkJ
A: 

If you don't like the idea of registering the COM object, take a look at registration-free COM.

http://msdn.microsoft.com/en-us/library/ms973913.aspx.

Martin