How to extract TypeLib from COM exe in command line

I recently needed to create an interop assembly. After some searching, I found tlbimp.exe . My next problem was that the .tlb file did not appear in my COM library. Googling further showed that the lib type is often included as a resource in exe / dll. Of course, the opening of exe in VS2010 showed that it is a type of lib and right-click later. I had a tlb file for use with tlbimp . Tall.

However, this is not a good process. Should I do this in the future, is there a way to extract a file of type Lib (.tlb) from .exe using the command line?

+4
source share
1 answer

Tlbimp.exe can handle the type library resource inside an EXE just fine. For instance:

 C:\temp\temp>tlbimp c:\windows\system32\wiaacmgr.exe Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1 Copyright (C) Microsoft Corporation. All rights reserved. Type library imported to WIAACMGRLib.dll 

Automating this is pretty risky. A type library is quite equivalent to an assembly reference. If it changes, you want to know about it. Not only because you may have to change your interaction code and test it, the Hell DLL also knocks on your door.

+8
source

All Articles