Type Libraries
You must create a type library for each set of exposed objects. Because VTBL references are bound at compile time, exposed objects that support VTBL binding must be described in a type library.
Type libraries provide these important benefits:
-
Type checking can be performed at compile time. This may help developers of ActiveX clients to write fast, correct code to access objects.
-
You can describe an interface with type information and implement IDispatch::Invoke for the interface using a single call to DispInvoke.
-
Visual Basic applications can create objects with specific interface types, rather than the generic Object type, to take advantage of early binding.
-
ActiveX clients that do not support VTBLs can read and cache DISPIDs at compile time, improving run-time performance.
-
Type browsers can scan the library, allowing others to see the characteristics of objects.
-
The RegisterTypeLib function can be used to register exposed objects in the registration database.
-
The UnRegisterTypeLib function can be used to completely uninstall an application from the system registry.
-
Local server access is improved because Automation uses information from the type library to package the parameters that are passed to an object in another process.