5

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

Community
  • 1
  • 1
Starceaker
  • 631
  • 2
  • 5
  • 14

2 Answers2

10

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
2

TblExp and regasm are only valid on .NET assemblies, what you have is most likely a standard non .NET COM DLL. So neither of those two commands are valid on this DLL.

Standard COM objects are registered using regsvr32. Try running that against your DLL and see if it registers correctly. If it does you should see it listed in Centura's ActiveX explorer.

shf301
  • 31,086
  • 2
  • 52
  • 86
  • I did notice afterwards TlbExp only worked on .NET assemblies. The TlbImp works on COM .dll's. Which caused the confusion for me. Regsvr32 will not work, this I know. Going to try out Hans Passant's suggestion. – Starceaker Dec 29 '10 at 08:00
  • I could no longer edit my comment, I meant that I already tried regsvr32 and it did not work. I'll try it again, it doesn't hurt to try. – Starceaker Dec 29 '10 at 08:07