LoadRegTypeLib

HRESULT LoadRegTypeLib( 
  REFGUID  rguid,             
  unsigned short  wVerMajor,  
  unsigned short  wVerMinor,  
  LCID  lcid,                 
  ITypeLib FAR* FAR*  pptlib  
);
 

Uses registry information to load a type library.

Parameters

rguid
The GUID of the library being loaded.
wVerMajor
Major version number of the library being loaded.
wVerMinor
Minor version number of the library being loaded.
lcid
National language code of the library being loaded.
pptlib
On return, points to a pointer to the loaded type library.

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 read from the file.
TYPE_E_INVALIDSTATE The type library could not be opened.
TYPE_E_INVDATAREAD The function could not read from the file.
TYPE_E_UNSUPFORMAT The type library has an older format.
TYPE_E_UNKNOWNLCID The passed in LCID could not be found in the OLE-supported DLLs.
TYPE_E_CANTLOADLIBRARY The type library or DLL could not be loaded.
Other return codes All FACILITY_STORAGE and system registry errors can also be returned.

Comments

The function LoadRegTypeLib defers to LoadTypeLib to load the file.

LoadRegTypeLib compares the requested version numbers against those found in the system registry, and takes one of the following actions:

QuickInfo

  Windows NT: Use version 3.1 and later.
  Windows: Use Windows 95 and later.
  Header: Declared in oleauto.h.
  Import Library: Link with oleaut32.lib.