TLIBIMP.EXE

From RAD Studio
Jump to: navigation, search

Go Up to Command-Line Utilities Index

TLIBIMP.EXE is a type library importer tool. Most of the features of TLIBIMP have been incorporated into the Type Library Editor in RAD Studio, and you can use the Type Library Editor instead of TLIBIMP if you prefer.

TLIBIMP creates an import type library for ActiveX controls, OLE servers, or COM servers. TLIBIMP uses a file named tlibimp.sym, which provides custom mapping for some type libraries. For more information about tlibimp.sym, see Mapping Symbol Names in a Type Library.

TLIBIMP Supports 32-bit and 64-bit Windows Type Libraries

TLIBIMP exists both as a 32-bit Windows utility and as a 64-bit Windows utility.

The 64-bit Windows version of TLIBIMP is installed on 64-bit Windows systems, in addition to the 32-bit Windows version.

The platform-dependent versions of TLIBIMP are installed in the following locations:

Utility Name    Platform Supported    Installation Location   
tlibimp.exe

32-bit windows

$(BDS)\bin\tlibimp.exe 
tlibimp.exe

64-bit Windows

$(BDS)\bin64\tlibimp.exe

TLIBIMP can be used to import either 32-bit Windows or 64-bit Windows type libraries, with the following considerations:

Although a 64-bit Windows application can use a 32-bit Windows type library (as some 64-bit MS Office applications do), a type library has a SYSKIND field that can be either SYS_WIN32 or SYS_WIN64. GenTLB.exe uses SYS_WIN32 as the default SYSKIND for type libraries.

However, GenTLB.exe uses SYS_WIN64 if the "-E64" switch is specified. And the IDE passes "-E64" to GenTLB.exe when the current target platform is 64-bit Windows.

For a type library that depends on another type library, the 32-bit Windows TLIBIMP looks only for a 32-bit Windows version of the dependent type library. So when you are importing a 64-bit Windows type library that depends on another type library that is registered only in the 64-bit Windows keys of the registry, you should instead use the 64-bit Windows version of TLIBIMP, found in:

$(bds)\bin64\tlibimp.exe

Use TLIBIMP Instead of #import

You must use TLIBIMP, not #import, to correctly import type libraries. For detailed information about changing from #import to TLIBIMP, see Migrating C++ Code from #import to TLIBIMP.EXE.

Command-Line Syntax

TLIBIMP [<options>] <typelibfile> 


Command-Line Elements

Element Description

<options>

Optional command-line options. They must be lowercase and preceded by either a hyphen (-) or a slash (/).

<typelibfile>

File of the type library.


To display the command-line help for TLIBIMP, enter:

tlibimp

or

tlibimp -?


Command-Line Options

Option Description
Import file types: At least one of these options must be specified: -C, -P or -I.

-C

Generate C++ import file.

-P

Generate Delphi import file.

-I

Generate .ridl (Restricted Interface Definition Language) import file.

Output file specification options:

-D<path>

Sets the output directory path <path>.

-Fe<name>

Sets the TLB suffix <name>. Use -Fe- to remove the use of the suffix.

-Ft<name>

Sets the TLB filename <name>. Use the file name without suffix.

-Ce<name>

Sets the OCX suffix <name>. Use -Ce- to remove the use of the suffix.

-Co<name>

Sets the OCX file name <name>. Use the file name without suffix.

Customize generated code options:

-Ha+

Create the IDE component for Controls.

-Hpa<name>

Set palette name for the IDE component for Controls.

-Hs+

Create the IDE component for Servers.

-Hps<name>

Set palette name for the IDE component for Servers.

-Hr+

Generate component registration.

C++ options:

-Cd-

Generate dispinterfaces.

-Cm-

Map dispinterfaces to dual.

-Cn<name>

Set namespace name.

-Cs+

declspec(__selectany) for GUIDs.

-Ct+

Force the use of a _TLB file.

-Cu+

Expose namespace with 'using'.

-Cv+

BCB4-style server events.

-Cw-

Use dispinterfaces in Control wrappers.

Delphi options:

-Ps+

Map dual HRESULT to safecall.

-Pt-

Map all HRESULT to safecall.

Miscellaneous options:

-O+

Generate CoClassCreator wrappers.

-R+

Process-dependent type libraries.

-XM-

Use MS-style getter/setter.

-W+

Emit warnings in files.

-Wc+

Emit comments in files.

Ignore Flags:

-Ya-

Ignore all special flags.

-Yc+

Ignore [CanCreate].

-Yh-

Ignore [Hidden].

-Yp-

Ignore [Predefined].

-Yr-

Ignore [Restricted].

See Also