@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The UnRegisterTypeLib function removes type library information from the system registry. Use this API to allow applications to properly uninstall themselves. In-process objects typically call this API from "DllUnregisterServer". !!!!C# Signature: [DllImport("oleaut32.dll", EntryPoint = "UnRegisterTypeLib", CharSet = CharSet.Auto, SetLastError = true)] private static extern int UnRegisterTypeLib( ref Guid libID, short wVerMajor, short wVerMinor, int lCID, SYSKIND tSysKind); !!!!VB.Net Signatures: 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 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: 'VB6 Type tGUID Data1 As Long Data2 As Integer Data3 As Integer Data4(0 To 7) As Byte End Type Enum eSYSKIND SYS_WIN16 = 0& SYS_WIN32 = 1& SYS_MAC = 2& SYS_WIN64 = 3& End Enum !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: In VB.Net you can substitute System.Runtime.InteropServices.SYSKIND@msdn for System.Runtime.InteropServices.ComTypes.SYSKIND@msdn, defined in mscorlib.dll. Note that in v2.0 (Whidbey) of the .NET Framework, the System.Runtime.InteropServices.SYSKIND interface has been deprecated in favor of System.Runtime.InteropServices.ComTypes.SYSKIND. !!!!Tips & Tricks: Please add some! !!!!Sample Code: 'VB.Net Register or Unregister a Type Library file 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) nResult = UnRegisterTypeLib(tlbAttr.guid, tlbAttr.wMajorVerNum, tlbAttr.wMinorVerNum, tlbAttr.lcid, tlbAttr.syskind) tlbAttr = Nothing TLB.ReleaseTLibAttr(tlbAttrPtr) 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 Documentation: UnRegisterTypeLib@msdn on MSDN (http://msdn2.microsoft.com/en-us/library/ms221085(VS.90).aspx)
Edit oleaut32.unregist...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.