Type Library (Delphi)

From RAD Studio
Jump to: navigation, search

Go Up to Delphi Options

Tools > Options > Language > Delphi Options > Type Library

Use this dialog box to select options for the Type Library editor.

Item Description

Ignore special CoClass Flags when importing

When you import an ActiveX Control, the type library importer only imports CoClasses that are not marked as Hidden, Restricted, or Predefined, and marked as Can Create (actually noncreatable). These flags are supposed to be set if the object is intended for general use. However, if you want to create a control for an internal application only, you can override the flags to generate the CoClass wrappers. In this case, you would select the Ignore special CoClass flags when importing, Hidden, Restricted, and deselect Can Create (noncreatable). Check the CoClass flags you want to ignore when importing ActiveX controls:

  • Predefined: Client applications should automatically create a single instance of this object.
  • Restricted: A CoClass marked restricted is supposed to be ignored by tools that access COM objects. It is exposed by the type library but restricted to those authorized to use it.
  • Hidden: The interface exists but should not be displayed in a user-oriented browser.
  • Can Create: The instance can be created with CoCreateInstance.

SafeCall function mapping

Determines which functions are declared as safecall when declarations specified in Delphi are converted to Restricted Interface Definition Language (RIDL) in the generated type library. Safecall functions automatically implement COM conventions for errors and exception handling, converting HRESULT error codes into exceptions. If you are entering function declarations in RIDL, you must explicitly specify the calling convention as safecall or stdcall.

  • All v-table interfaces: SafeCall is used for all interfaces.
  • Only dual interfaces: SafeCall is used only for dual interfaces.
  • Do not map: The SafeCall calling convention is not used.

For more information about safecall, see System.SysUtils.ESafecallException, System.SafeCallErrorProc, and System.TObject.SafeCallException.

Display updates

Displays the Apply Updates dialog box, which provides a chance to preview proposed changes to the sources when you try to refresh, save, or register the type library. If this option is not checked, the Type Library Editor automatically updates the sources of the associated object when you make changes in the editor.

Type Library Editor and RIDL Options

Item Description

Lookup referred type libraries in the registry

An importlib statement in a .ridl file does not specify the full path of a type library. When this check box is selected, the Type Library Editor looks up files in the registry of type libraries on the system. You can view the list of registered type libraries by using the Show All Type Libraries command on the Design pane of the Type Library Editor.

Store Unicode data as UTF8 in type library

When you use Unicode identifiers, you must enable saving of data as UTF8. Also note that you can use Unicode identifiers only with Delphi and C++ clients and servers (that is, clients and servers that are not products of Embarcadero might not assume that identifiers are UTF8-encoded).

Check for UTF8 data in type library

This option enables the decoding of UTF8 data in the type library. If the previous option (Store Unicode data as UTF8) is checked, make sure that this option is also checked.

Refresh implementation when renaming type library

Refreshes the type library implementation when you rename the type library, as if you had clicked the Refresh Implementation button on the Type Library Editor.

Refresh implementation when .ridl file is saved

Refreshes the type library implementation each time you save the .ridl file, as if you had clicked the Refresh Implementation button on the Type Library Editor.

See Also