Click here to Skip to main content
15,566,615 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I work in an IT company where I was given a task to convert a VB project to VB.NET. Evrything went well in the conversion and as a result I got a successfull build after some minor changes in the code in VB.NET.

But when I made the project to run, it throwed a run time exception as "Creating an instance of the COM component with CLSID {XXXXX} from the IClassFactory failed due to the following error :80004004" when the project accessed a reference file (DLL which has file type as ACTIVEX in its properties).

The strange thing is the Dll name used by VB was EXECU.dll. But after the conversion the reference was changed to interop.ECECU.dll

Even when I tried to add the reference manually to the dll EXECU.dll, its refernce automatically changes its name to interop.EXECU.dll.

When I browsed the dll content in the object browser I found that the DLL was having the class EXECU inside the namespace (library) but the class was not having any function in it.

Do I have to run anything to get the full functionality of the original DLL?
Posted
Updated 18-Oct-10 22:32pm
v2
Comments
Dalek Dave 19-Oct-10 3:32am    
Edited for Readability.
Toli Cuturicu 19-Oct-10 7:02am    
Did it also change the X into a C ? (EXECU -> ECECU) as you wrote or is it a typo?
NaveenSoftwares 19-Oct-10 8:29am    
NO. Sorry! and Thanks too

Try registering COM+
Command:

C:\Program Files\Microsoft Visual Studio 9.0\VC>
RegAsm Example.dll /tlb:Example.tlb /codebase

Note: Do not use regsvr32 for registering COM+.
 
Share this answer
 
v2
Comments
NaveenSoftwares 19-Oct-10 7:05am    
Do I have to register the old dll(EXECU.dll) or the converted dll (interop.EXECU.dll) which is found in obj\debug after the convresion?
Hi,
I found the answer. This dll was a COM type (Not .NET type). So we have to register only by regsvr32. Further the error "Creating an instance of the COM" was related to registry security in the dll (nothing can be done by us. It works only in specific servers) :(

Anyway thanks.

Now I got to know the basic steps in importing a COM type dll to .NET

1)Registration (Using regsvr32)

2)Converting to .NET type either by
a)Automatic conversion when you add the registered COM DLL (Active X) to the reference (or)
b)Coverting manually by using tlbimp (.dll) and then adding it as reference.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900