VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

ActiveX Dll Register/UnRegister

Robert J May  (1 Submission)   OLE/COM/DCOM/Active-X   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

This code shows how to register and unregister ActiveX dlls programatically, without relying on regsvr32 for the task. It's built into a reuseable class that can be put in your own code or compiled into a dll. Based very loosely on code from Vasudevan S.

Inputs
The file name

Returns
7 flags. See the enumeration and sample code for details.

API Declarations
Private Declare Function LoadLibraryRegister Lib "KERNEL32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibraryRegister Lib "KERNEL32" Alias "FreeLibrary" (ByVal hLibModule As Long) As Long
Private Declare Function CloseHandle Lib "KERNEL32" (ByVal hObject As Long) As Long
Private Declare Function GetProcAddressRegister Lib "KERNEL32" Alias "GetProcAddress" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function CreateThreadForRegister Lib "KERNEL32" Alias "CreateThread" (lpThreadAttributes As Long, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpparameter As Long, ByVal dwCreationFlags As Long, lpThreadID As Long) As Long
Private Declare Function WaitForSingleObject Lib "KERNEL32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function GetExitCodeThread Lib "KERNEL32" (ByVal hThread As Long, lpExitCode As Long) As Long
Private Declare Sub ExitThread Lib "KERNEL32" (ByVal dwExitCode As Long)

Rate ActiveX Dll Register/UnRegister (13(13 Vote))
ActiveX Dll Register/UnRegister.bas

ActiveX Dll Register/UnRegister Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters