Many technological devices are often very hard to understand and use without a description of that device and its uses—an owner's manual. For an object or component, type information is the owner's manual, in which is described an object's CLSID, its interfaces, their IIDs, their member functions, and the return value and arguments of those functions. This is combined with brief help information, references to a complete help file, and even exported functions from DLLs. In short, type information is the combination of a header file, a help file, and an import library.
A type library is a collection of type information elements for one or more objects and one or more interfaces as well as a repository for type definitions and module export lists. The elements in a type library, including the library itself, can be given a wide range of attributes to describe their characteristics as can even the individual member functions of interfaces. A library is also assigned a locale identifier describing the national language in which the library is written.
Type libraries are created through a standard OLE service involving the interfaces ICreateTypeLib and ICreateTypeInfo. The tool MKTYPLIB.EXE works in conjunction with the Object Description Language (ODL) to automate the process of library creation, allowing the developer to define interfaces and classes in a C++ style notation. Once the library is created, clients and components access type information through another standard OLE service involving several API functions and the interfaces ITypeLib and ITypeInfo, which provide structured access to the information. The interface ITypeComp provides high-speed unstructured access for the purposes of compilers.
OLE defines specific registry entries to associate a type library with an object's CLSID, providing a way for clients to read up on an object before ever instantiating it. When an object already exists, the interface IProvideClassInfo allows the client to ask an object for its type information directly.