i need vb to tell me if the user a has a certain dll ison their computer and properly registered. how do i do this?
Printable View
i need vb to tell me if the user a has a certain dll ison their computer and properly registered. how do i do this?
I don't think there is a way to check if it has been registered already. But registering it again won't hurt it.
Code:Shell "regsvr32 C:\Windows\System\MyControl.ocx" 'or .dll
the reason i need to do this is b/c my program will proform
an operation with a certain dll if the dll is installed.
otherwise the program goes through a process that only works 50% of the time error free.
i'm trying to use the dll anytime i can but i dont want to ship it with my program.
so if anyone knows how to check for the dll (if it is possible) please tell me. thanks.
To see if the dll exists on the users computer?
Use the Dir function.
Code:If Dir("C:\Windows\System\MyControl.dll") = "" Then
Msgbox "Dll file doesn't exist! Please email me for it!", vbCritical
End If
You could use late binding, and trap the error if it isn't properly registered. The disadvantage of late binding is a slight loss of performance.
eg
Private MySub()
Dim MyObj as Object
On Error Goto HandleIt
Set MyObj = CreateObject("Word.Application")
' do some stuff
Exit Sub
HandleIt:
MsgBox "Word is not installed"
End Sub