Windows Mobile 6.5
A version of this page is also available for

This method retrieves a pointer to the ITypeComp for a type library. This enables a client compiler to bind to the library's types, variables, constants, and global functions.

HRESULT GetLibAttr( 
  ITypeComp FAR* FAR* ppTComp 


[out] Pointer to a pointer to the ITypeComp instance for this ITypeLib. A client compiler uses the methods in the ITypeComp interface to bind to types in ITypeLib, as well as to the global functions, variables, and constants defined in ITypeLib.

The following table shows the return values for this function.

Value Description




Out of memory.


One or more of the parameters is invalid.


The function could not read from the file.


Invalid data.


The type library has an older format.


The type library could not be opened.


Type mismatch.

The ITypeComp::Bind function of the returned TypeComp binds to global functions, variables, constants, enumerated values, and coclass members.

The Bind function also binds the names of the TYPEKIND enumerations of TKIND_MODULE, TKIND_ENUM, and TKIND_COCLASS. These names shadow any global names defined within the type information.

The members of TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS types marked as Application objects can be directly bound to from ITypeComp without specifying the name of the module.

Bind and ITypeComp::BindType accept only unqualified names. GetTypeComp returns a pointer to the ITypeComp interface, which is then used to bind to global elements in the library. The names of some types (TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS) share the name space with variables, functions, constants, and enumerators.

If a member requires qualification to differentiate it from other items in the name space, GetTypeComp can be called successively for each qualifier to bind to the member. This allows programming language compilers to access members of modules, enumerations, and coclasses, even though the member cannot be bound to with a qualified name.

Headeroaidl.h, oaidl.idl
Libraryoleaut32.lib, uuid.lib
Windows Embedded CEWindows CE 2.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions