ImportTypeLib Documentation

Usage Information - General Usage

The ImportTypeLib() function is the heart of ImportTypeLib. It is called by a script to load and enwrap a type library.

ImportTypeLib()

Loads a type library object.
ImportTypeLib(File)
ImportTypeLib(GUID [, Version = "1.0"])

Parameter

File The file that contains the type library. This should be a *.exe, *.dll, *.olb or *.tlb file. In case it is not a *.tlb file and therefore not a standalone type library, a type library resource is loaded. This defaults to the first type library resource in that specified file. To load another resource, append the index to the path:
lib := ImportTypeLib("C:\Path\to\file.dll\2") ; loads the 2nd type library
GUID If a GUID is specified, a type library registered within the system is loaded. The GUID is the library GUID of the type library, which must be present in the registry under HKCR\TypeLib\.
Version In case a registered type library is loaded, a version may be specified. Use the format major.minor as in the default value 1.0.

Returns

A type library object representing the loaded library.

Throws

When an error occurs during loading of the type library or the creation of the wrapper object, an exception is thrown.