Note: This website is archived. For up-to-date information about D projects and development, please visit

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.


tlbPathThe path to a file containing a COM type library, or a GUID identifying the type library.
/commentsAdds documentation and other data from the type library as comments.
/noblanksOmits blank lines between members.
/noenumsPrevents Tlbimpd.exe from adding names to enums.
/nologoSuppresses the startup banner display.
/silentSuppresses all output except errors.
/tabsIndents new lines with tabs instead of spaces.
/indent:indentCountIndents new lines with the specified number of spaces.
/braces:newLinePlaces braces on a new line.
/module:moduleNameSpecifies the name of the module to be produced.
/out:fileNameSpecifies the file name of the module to be produced.
/propget:prefixSpecifies the prefix to use for property getters.
/propput:prefixSpecifies the prefix to use for property setters.
/unnamed:valueSpecifies the value used for unnamed parameters.
/order:verbatimGenerate 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; +/


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.)