Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using tlbexp.exe on a COM dll

I am trying to set up communication between Centura and a COM .dll. (Downloaded from http://download.resip.fr for a database import)

Centura requires a .tlb file to be able to communicate to this component. Normally I would use regasm /tlb to generate the .tlb but seeing as it is a COM .dll this is not possible.

I found that I could use tlbexp for .NET dll's: http://msdn.microsoft.com/en-us/library/hfzzah2c(v=vs.80).aspx

I tried this out, knowing it would probably fail (as I have COM .dll). I received this error:

TlbExp : error TX0000 : Could not load file or assembly 'file:///C:\Windows\system32\ResipBcb.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

Using Dependency Walker I noticed two .dll's missing. I found ieshims.dll online but I can't find the wer.dll. See this question.
I don't know if the tlbexp failure has anything to do with this file that is missing?

To sum up, my question is: How do I get a .tlb from this .dll? I can't seem to find any way to extract the .tlb out of this COM .dll.

Best regards
Clint Cambier

like image 872
Starceaker Avatar asked Dec 28 '10 15:12

Starceaker


People also ask

What is Tlbexp exe?

Tlbexp.exe generates a type library that contains definitions of the types defined in the assembly. Applications such as Visual Basic 6.0 can use the generated type library to bind to the . NET types defined in the assembly.

What is Tlbimp exe used for?

Tlbimp.exe (Type Library Importer) - . NET Framework. Use Tlbimp.exe, the Type Library Importer. This tool converts type definitions found within a COM type library into equivalent definitions in a CLR assembly.

Where is Tlbimp exe located?

Open a Windows Command Prompt. Navigate to C:\Program Files\Microsoft SDKs\Windows\vx. x\Bin in which the earlier . NET Framework version of TlbImp.exe is installed.


1 Answers

What you are trying to do only works for .NET assemblies, not native COM servers. The type library for them is almost always embedded inside the DLL. In Visual Studio, use File + Open + File and select the DLL. Open the "TYPELIB" node, right-click the resource (usually 1), Export. Save it to, say, a project directory, use the .tlb filename extension.

like image 112
Hans Passant Avatar answered Sep 27 '22 21:09

Hans Passant