Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than oleaut32, prefix the name with the module name and a period.
UnRegisterTypeLib (oleaut32)
.
C# Signature:
[DllImport("oleaut32.dll", SetLastError=true)]
static extern TODO UnRegisterTypeLib(TODO);
[DllImport("oleaut32.dll")]
static extern TODO UnRegisterTypeLib(TODO);
Possible VB.Net Signatures:
Declare Function UnRegisterTypeLib Lib "oleaut32.dll" (TODO) As TODO ???
Declare Function UnRegisterTypeLib Lib "oleaut32.dll" (LibID As System.GUID, ByVal nVerMajor As Short, ByVal nVerMinor As Short, ByVal lCID As Integer, ByVal tSysKind As System.Runtime.InteropServices.ComTypes.SYSKIND) As Integer
VB 6 Signature:
Declare Function UnRegisterTypeLib Lib "oleaut32.dll" (LibID As tGUID, ByVal nVerMajor As Integer, ByVal nVerMinor As Integer, ByVal lCID As Long, ByVal tSysKind As eSYSKIND) As Long
User-Defined Types:
Type tGUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
'VB.Net
Private Declare Unicode Function LoadTypeLib Lib "oleaut32.dll" (ByVal TLpszModule As String, ByRef TPpTypeLib As ComTypes.ITypeLib2) As Integer
Private Declare Unicode Function RegisterTypeLib Lib "oleaut32.dll" (ByVal ptlib As ComTypes.ITypeLib2, ByVal szFullPath As String, ByVal szHelpDir As String) As Integer
Private Declare Unicode Function UnRegisterTypeLib Lib "oleaut32.dll" (ByRef LibID As System.Guid, ByVal nVerMajor As Short, ByVal nVerMinor As Short, ByVal lCID As Integer, ByVal tSysKind As ComTypes.SYSKIND) As Integer
Private Const ERROR_SUCCESS As Short = 0
Public Function RegisterTLib(ByVal strFile As String, ByVal bRegister As Boolean) As Boolean
Dim nResult As Integer
Dim TLB As ComTypes.ITypeLib2 = Nothing
Dim tlbAttrPtr As IntPtr
Dim tlbAttr As ComTypes.TYPELIBATTR
On Error Resume Next
If My.Computer.FileSystem.FileExists(strFile) = False Then
RegisterTLib = False
Else
nResult = LoadTypeLib(strFile, TLB)
If nResult = ERROR_SUCCESS Then
If bRegister Then
nResult = RegisterTypeLib(TLB, strFile, Nothing)
If nResult = ERROR_SUCCESS Then 'success
RegisterTLib = true
Else 'failure
RegisterTLib = False
End If
Else
TLB.GetLibAttr(tlbAttrPtr)
tlbAttr = CType(Marshal.PtrToStructure(tlbAttrPtr, GetType(ComTypes.TYPELIBATTR)), ComTypes.TYPELIBATTR)
If nResult = ERROR_SUCCESS Then 'success
RegisterTLib = True
Else 'failure
RegisterTLib = False
End If
End If
Else ' error loading the TypeLibrary file
RegisterTLib = False
End If
End If
End Function
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).