Loading and Registering a Type Library

The Automation dynamic link library, Oleaut32.dll, provides several functions that you can call to load and register a type library. Calling LoadTypeLibEx, as shown in this example, both loads the library and creates the registry entries.

Example

ITypeLib *pTypeLib;
HRESULT hr;
hr = LoadTypeLibEx("example.tlb", REGKIND_REGISTER, &pTypeLib);
if(SUCCEEDED(hr))
{
    pTypeLib->Release();
} 
 

For a complete listing of the functions in Oleaut32.dll that provide loading, registering, and querying of type libraries, see Overview of Type Compilation and Library Functions and Registering a Type Library, in the Automation Programmer's Reference.