再论Type Library Exporter (Tlbexp.exe)

The Type Library Exporter generates a type library that describes the types defined in a common language runtime assembly.

tlbexp assemblyName [/out:file] [/nologo] [/silent] [/verbose]

 

The Type Library Exporter is supported on Microsoft Windows 2000 and later.

The following command generates a type library with the same name as the assembly found in myTest.dll.

tlbexp myTest.dll

The following command generates a type library with the name clipper.tlb.

tlbexp myTest.dll /out:clipper.tlb

The following example illustrates using Tlbexp.exe to export a type library from an assembly that references assemblies that were imported using Tlbimp.exe.

First use Tlbimp.exe to import the type library myLib.tlb and save it as myLib.dll.

tlbimp myLib.tlb /out:myLib.dll

The following command uses the C# compiler to compile the Sample.dll, which references myLib.dll created in the previous example.

CSC Sample.cs /reference:myLib.dll /out:Sample.dll

The following command generates a type library for Sample.dll that references myLib.dll.

tlbexp Sample.dll

 

 

posted on 2010-04-18 12:22  Acor  阅读(355)  评论(0编辑  收藏  举报

导航