Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function adds information about a type library to the system registry.

Syntax

HRESULT RegisterTypeLib( 
  ITypeLib FAR* 
ptlib, 
  OLECHAR FAR* 
szFullPath, 
  OLECHAR FAR* 
szHelpDir 
); 

Parameters

ptlib

[in] Pointer to the type library being registered.

szFullPath

[in] Null-terminated string that contains the fully qualified path specification for the type library being registered.

szHelpDir

[in] Null-terminated string that contains the directory in which the Help file for the library being registered can be found. Can be NULL.

Return Value

Returns the HRESULT values shown in the following table.

Value Description

S_OK

Success.

E_OUTOFMEMORY

Out of memory.

E_INVALIDARG

One or more 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.

Remarks

Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application.

The function RegisterTypeLibcan be used during application initialization to register the application's type library correctly.

Unlike the Windows desktop, on Windows Embedded CE, RegisterTypeLibwill not add entries for each of the dispinterfaces and Automation-compatible interfaces.

Coclasses are not registered (that is, RegisterTypeLibdoes not write any values to the CLSID key of the coclass).

Requirements

Header oleauto.h
Library oleaut32.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also