Type Library Importer (tlbimpd)
The Type Library Importer converts type definitions found within a COM type library into equivalent definitions in the D language. It outputs a source code file containing the types defined by the library, perfoming a similar task to the #import directive in Visual C++ or the tlbimp tool for C#.
Command Line
The program can generate a module for a type library specified as the first argument. The first argument may be the path to a DLL (Dynamic Link Library), TLB (Type Library) or OLB (Microsoft Office Type Library) file containing a valid type library; a GUID identifying the type library; or the path to a D source file. If the argument is a path to a D source file and the file contains a special version of the import directive that it recognises, the arguments in the directive are passed back to the program to process.
Parameters
| Parameter | Description |
| tlbPath | The path to a file containing a COM type library, or a GUID identifying the type library. |
| Option | Description |
| /comments | Adds documentation and other data from the type library as comments. |
| /noblanks | Omits blank lines between members. |
| /noenums | Prevents Tlbimpd.exe from adding names to enums. |
| /nologo | Suppresses the startup banner display. |
| /silent | Suppresses all output except errors. |
| /tabs | Indents new lines with tabs instead of spaces. |
| /indent:indentCount | Indents new lines with the specified number of spaces. |
| /braces:newLine | Places braces on a new line. |
| /module:moduleName | Specifies the name of the module to be produced. |
| /out:fileName | Specifies the file name of the module to be produced. |
| /propget:prefix | Specifies the prefix to use for property getters. |
| /propput:prefix | Specifies the prefix to use for property setters. |
| /unnamed:value | Specifies the value used for unnamed parameters. |
| /order:verbatim | Generate types in the original order they are found in the type library. |
| /? | Displays command line options. |
// This example generates a module named xml.dom in dom.d.
tlbimpd msxml6.dll /comments /module:xml.dom /out:dom.d
// This example renames property set accessors 'put'.
tlbimpd msxml6.dll /comments /propput:put
// This examples resolves the GUID to a type library.
tlbimpd {f5078f18-c551-11d3-89b9-0000f81fe221} /comments
// This example uses the special import directive. If found in a source file, it is passed to tlbimpd.exe and processed.
/+ @import msxml6.dll comments; +/
Download
Click here to download tlbimpd (zip file).
Related Pages
This page may be useful for those who are trying to use tlbimpd. (Note: refers to an early version of Juno and may not be relevant to the latest version.)
