Loads a type library and (optionally) registers it in the system registry.
HRESULT LoadTypeLibEx(
LPCOLESTR szFile,
REGKIND regkind,
ITypeLib** pptlib
);
- szFile
Specification for the type library file.
- regkind
Identifies the kind of registration to perform for the type library based on the following flags: DEFAULT, REGISTER and NONE. REGKIND_DEFAULT simply calls LoadTypeLib and registration occurs based on the LoadTypeLib registration rules. REGKIND_NONE calls LoadTypeLib without the registration process enabled. REGKIND_REGISTER calls LoadTypeLib followed by RegisterTypeLib, which registers the type library. To unregister the type library, use UnRegisterTypeLib.
typedef enum tagREGKIND
{
REGKIND_DEFAULT,
REGKIND_REGISTER,
REGKIND_NONE
} REGKIND;
- pptlib
Reference to the type library being loaded.
The return value obtained from the returned HRESULT is one of the following:
Return value | Meaning |
|---|
S_OK | Success. |
E_OUTOFMEMORY | Out of memory. |
E_INVALIDARG | One or more of the arguments is invalid. |
TYPE_E_IOERROR | The function could not write to the file. |
TYPE_E_REGISTRYACCESS | The system registration database could not be opened. |
TYPE_E_INVALIDSTATE | The type library could not be opened. |
TYPE_E_CANTLOADLIBRARY | The type library or DLL could not be loaded. |
Enables programmers to specify whether or not the type library should be loaded.
Concepts