RAD Studio |  |

Opening an Existing Type Library
See Also
Collapse All

When you use the wizards to create an Automation object, COM object, transactional object, or a remote data module, a type library is automatically created with an implementation unit. Starting with the 2009 product, the wizards create type libraries in a text-based format (RIDL files). However, you can still open type libraries in .tlb format that are associated with previous versions or other products (servers) that are available on your system. The Type Library Explorer enables you to examine .tlb files.

To open a legacy type library (.tlb file)

1. Choose FileOpen.
2. In the Open dialog box, set the File Type to type library.
3. Navigate to the desired .tlb file and choose Open.

The Type Library Exploreropens in the Code Editor. You can view the type library but you cannot edit it in the Explorer.
To open a type library created with a COM wizard in the 2009 product

1. In the Project Manager, locate the .ridl file associated with your project.
2. Double-click the .ridl file.

The Type Library Editor opens in the Code Editor window.

Alternatively, you can choose ViewType Library. On the Design page of the Type Library Editor, you can add interfaces, CoClasses, and other elements of the type library such as enumerations, properties, and methods.

Note: Changes you make to any type library information with the Type Library Editor
can be automatically reflected in the associated implementation class. If you want to review the changes before they are added, be sure that the Apply Updates dialog is checked on. It is on by default and can be changed in the setting "Display updates before refreshing" on theToolsOptionsDelphi OptionsType Library page.
Tip: When writing client applications, you typically do not need to open the type library. You only need the Project_TLB unit that was generated by the Import Component wizard or by TLIBIMP, not the type library itself. You can add this file directly to a client project, or, if the type library is registered on your system, you can use the Import Type Library dialog (Component ->Import Type Library
).
See Also

Creating a New Type Library

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!