Next Previous Up Top Contents Index

4.12 The OLE-AUTOMATION module

register-type-library

Function

Summary

register-type-library typeinfo => ()

Arguments

typeinfo
An instance of <ITypeInfo>.

Values

None.

Description

Creates an OLE/COM type library file from the given type information and records it in Windows Registry, associating it with this Automation server.

If the server was invoked with the command line option /UnregServer or -UnregServer, this function attempts to delete the type library from the registry.

This function returns no values.

The type library file that is created is placed in the same directory as the server (.EXE) file, and will have the same name but with the version and locale numbers appended, and the extension .TLB. For example, foo.exe might become foo-2-1-0.tlb.

Automation controllers and other utilities can use the type library to find out what facilities are provided by the Automation server the type library describes, without actually executing the server.

It is not mandatory to create and register a type library for your Automation server, since the server itself does not use it, and an Automation controller does not necessarily need it either. If a connected controller requests the type library, it will use the registered one if it exists, or else force the type library to be created and registered dynamically.

Normally the argument should be an instance of <coclass-type-info>, although if there is just a single dispinterface, it is also possible to pass an instance of <disp-type-info> provided it was created with a unique uuid: argument (not just $IID-IDispatch); it will then act as both an Interface ID and a Class ID.

The type library can be identified by its version number and locale as well as its Class ID (type info options major-version:, minor-version:, locale:, and uuid:, respectively) so different versions of an application can be installed at the same time, and one application can register multiple type libraries with different locales (but the same Class ID, version, and help directory). (However, there will still be only one call to make-object-factory, since it does not depend on the locale.)


OLE, COM, ActiveX and DBMS Reference - 31 MAR 2000

Next Previous Up Top Contents Index