I want to check whether a dll is registered on the client machine or not, if not it should be registered. to check whether the dll is registered or not i wrote the code as,
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal _
lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Function IsDLLAvailable(ByVal DllFilename As String) As Boolean
Dim hModule As Long
' attempt to load the module
hModule = LoadLibrary(DllFilename)
If hModule > 32 Then
FreeLibrary(hModule) ' decrement the DLL usage counter
IsDLLAvailable = True
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If IsDLLAvailable("SHDOCVW.dll") Then
MsgBox("OK")
Else
Beep()
MsgBox(Err.LastDllError)
End If
End Sub
Now i want to add a dll in registry using vb.net code, how to do this? and what is the path where the dll's are stored in the registry editor?
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal _
lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Function IsDLLAvailable(ByVal DllFilename As String) As Boolean
Dim hModule As Long
' attempt to load the module
hModule = LoadLibrary(DllFilename)
If hModule > 32 Then
FreeLibrary(hModule) ' decrement the DLL usage counter
IsDLLAvailable = True
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If IsDLLAvailable("SHDOCVW.dll") Then
MsgBox("OK")
Else
Beep()
MsgBox(Err.LastDllError)
End If
End Sub
Now i want to add a dll in registry using vb.net code, how to do this? and what is the path where the dll's are stored in the registry editor?