Component Automation
LoadTypeLibEx

HRESULT LoadTypeLibEx(  

  LPCOLESTR  szFile, 

  REGKIND  regkind,  

  ITypeLib**  pptlib   

);
Remarks

Loads a type library and (optionally) registers it in the system registry.

Parameters

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.

Return Value

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.

Comments

Enables programmers to specify whether or not the type library should be loaded.

Requirements

For an explanation of the requirement values, see Requirements.

  Windows NT/2000: Requires Windows NT 3.1 or later.  Windows 95/98: Requires Windows 95 OSR2 or later.  Header: Declared in oleauto.h.  Library: Use oleaut32.lib.

Page view tracker