General information
Title:
Registering a DLL or OCX from VB
Can anyone tell me what is wrong with this? Or is there a better way?
Private Sub Command2_Click()
Dim ret As Long
Dim myfile, myexe, fullpath As String
myexe = "regsvr32.exe /s "
myfile = """" & App.Path & "\ScrRun.Dll" & """"
fullpath = myexe & myfile
ret = ShellExecute(App.hInstance, "Open", fullpath, "", "", 1)
MsgBox ret
End Sub
My ret value is a '2' which, I think, means 'ERROR_PATH_NOT_FOUND', but when I cut and paste my "fullpath" value into the Start->Run it works fine and registers my dll.
Help please.
Thanking you in advance for your help.
~brad
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only