ImportTypeLib Documentation

Usage Information - Type Library Objects

Type Library Objects are objects returned by the ImportTypeLib() function. They are used to manage the loaded type library.

Retrieving a GUID

The GetGUID() method can be used to obtain a GUID for the type library itself or for any contained type.
guid := ITL_TypeLibWrapper.GetGUID([obj = -1, returnRaw = false, passRaw = false])

Parameter

obj

Represents the object to retrieve the GUID for. If omitted or set to -1, the GUID for the type library itself is returned.

Otherwise, it can be set to

  • the index of the type in the type library:
    guid := lib.GetGUID(3)
  • the name of the type in the type library:
    guid := lib.GetGUID("IMyInterface")
  • the type object itself:
    guid := lib.GetGUID(lib.IMyInterface)
  • a raw pointer to an ITypeInfo COM interface. See the passRaw parameter for more information.

returnRaw If set to true, the GUID is returned as memory pointer. Otherwise (default behaviour), it is returned as string.
passRaw Not commonly used: To pass a raw ITypeInfo pointer for the obj parameter, this must be set to true (to distinguish the pointer from an index).

Returns

The return value is usually a string representing the GUID, unless the returnRaw parameter has been set to true, in whch case a memory pointer is returned.

Throws

If an invalid type object or type name was given, or if any of the necessary steps to retrieve the GUID fails, an exception is thrown.

Remarks

The returned GUID is the IID for an interface, the CLSID for a class or the LIBID for the type library.

... More to come ...

...