please can anyone tell me how to register a dll file???
Printable View
please can anyone tell me how to register a dll file???
Select Run from the start menu and type this in:
regsvr mydll.dll
or if you need it from VB
Gl,Code:Shell("regsvr32 mydll.dll")
D!m
[Edited by Dim on 11-12-2000 at 08:26 PM]
So you dont get the dialog box popping up
Code:Shell("regsvr32 /s mydll.dll")
You could also use the DllRegisterServer and DllUnregisterServer api functions to register and unregister the dlls/ocxs.
Code:Option Explicit
'MyDll.Dll is the dll/ocx that you want to register
Private Declare Function DllRegisterServer Lib "MyDll.Dll" () As Long
Private Declare Function DllUnregisterServer Lib "MyDll.Dll" () As Long
Const ERROR_SUCCESS = &H0
Private Sub Command1_Click()
'Register
If DllRegisterServer = ERROR_SUCCESS Then
MsgBox "Registration Successful"
Else
MsgBox "Registration Unsuccessful"
End If
End Sub
Private Sub Command2_Click()
'UnRegister
If DllUnregisterServer = ERROR_SUCCESS Then
MsgBox "UnRegistration Successful"
Else
MsgBox "UnRegistration Unsuccessful"
End If
End Sub