LoadRegTypeLib
This function uses registry information to load a type library.
HRESULT LoadRegTypeLib(
REFGUID rguid,
unsigned short wVerMajor,
unsigned short wVerMinor,
LCID lcid,
ITypeLib FAR *FAR *pptlib );
Parameters
- rguid
Globally unique identifier (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, pointer to a pointer to the loaded type library.
Return Values
One of the values obtained from the returned HRESULT and described in the following table is returned.
| Value | Description |
|---|---|
| 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. |
Remarks
Only typelib2 type library is supported and loadable from resource.
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:
- If one of the registered libraries exactly matches both the requested major and minor version numbers, then that type library is loaded.
- If one or more registered type libraries exactly match the requested major version number, and has a greater minor version number than that requested, the one with the greatest minor version number is loaded.
- If none of the registered type libraries exactly match the requested major version number (or if none of those that do exactly match the major version number also have a minor version number greater than or equal to the requested minor version number), then LoadRegTypeLib returns an error.
Passing into this function any invalid and, under some circumstances, NULL pointers will result in unexpected termination of the application.
Requirements
| Runs on | Versions | Defined in | Include | Link to |
|---|---|---|---|---|
| Windows CE OS | 2.0 and later | Oleauto.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.