RegisterTypeLib (oleaut32)
Last changed: MDell-64.201.38.167

.
Summary
Adds information about a type library to the registry.

C# Signatures:

[DllImport("oleaut32.dll")]
static extern int RegisterTypeLib(ITypeLib ptlib,
   [MarshalAs(UnmanagedType.BStr)] string szFullPath,
   [MarshalAs(UnmanagedType.BStr)] string szHelpDir);

[DllImport("oleaut32.dll", PreserveSig=false)]
static extern void RegisterTypeLib(ITypeLib ptlib,
   [MarshalAs(UnmanagedType.BStr)] string szFullPath,
   [MarshalAs(UnmanagedType.BStr)] string szHelpDir);

VB.Net Signature:

Declare Unicode Function RegisterTypeLib Lib "oleaut32.dll" (ByVal ptlib As System.Runtime.InteropServices.ComTypes.ITypeLib, ByVal szFullPath As String, ByVal szHelpDir As String) As Integer

VB 6 Signature:

Declare Function RegisterTypeLib Lib "oleaut32.dll" (ByVal pTLB As Object, szFullPath As Byte, szHelpFile As Byte) As Long

User-Defined Types:

For the ITypeLib parameter in C#, you can use System.Runtime.InteropServices.UCOMITypeLib, already defined in mscorlib.dll. Note that in v2.0 (Whidbey) of the .NET Framework, this interface has been deprecated in favor of System.Runtime.InteropServices.ComTypes.ITypeLib.

In VB.Net you can substitute ComTypes.ITypeLib2 or UCOMITypeLib for ComTypes.ITypeLib. All of those are defined in System.Runtime.InteropServices.

Notes:

In C# The first signature returns the raw HRESULT. The second signature throws an exception when a failure HRESULT is returned.

Ensure that you use the same parameter type in LoadTypeLib in either language.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

Do you know one? Please contribute it!

Documentation