Type Library Elements

If you walk around a "real-life" library, you'll usually see books of many shapes and sizes that deal with a wide range of topics. That's what you'd expect for the almost limitless domain of human knowledge. Fortunately, a type library is somewhat simpler (reflecting the limited domain of component information). Any element in a type library falls into one of the five categories described in Table 3-1.

Element

Purpose

coclass

Describes the interfaces and dispinterfaces implemented on a particular object (identified by a CLSID).

interface

Describes a vtable interface (identified by an IID): specifically, the names of member functions, the return types of those functions, and the names and types of the arguments to those functions.

dispinterface

Describes a dispatch interface (identified by an IID) used by OLE Automation: specifically, the names, dispIDs, and types of the methods and properties (including return types and argument names and types for methods in the interface).

module

Describes a DLL module (identified by a DLL filename), including names and ordinals for exported functions and global variables.

typedef

Describes a user-defined data structure, enumeration, or union (identified by a name or an optional GUID).


Table 3-1.

The kinds of elements in a type library.

Dealing with type information is in large part finding the element you want and working with the specific information in that element. This varies, of course, from element to element.