Getting COM Exception 80040154 on different machine
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 D开发者_如何学GoLL 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.
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.
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.
精彩评论