OCX registeration[Solved]
I want to register "MSINET.OCX" and "MSWINSCK.OCX"(not on my computer)...... I've tried the following codes (in a friend's computer) but they all gave the same error, "system error &h8007007e (-2147024770). The specified module could not be fonund." . The codes are:
VB Code:
Public Function RegisterServer(hWnd As Long, DllServerPath As String, bRegister As Boolean)
On Error Resume Next
'KPD-Team 2000
'URL: [url]http://www.allapi.net/[/url]
'We're going to call an API-function, without declaring it!
' Modified by G. Kleijer
' going to call the DllRegisterServer/DllUnRegisterServer API of the specified library.
' there's no need to use the Regsvr32.exe anymore.
' Make sure the path is correct and that the file exists, otherwise VB will crash.
Dim lb As Long, pa As Long
lb = LoadLibrary(DllServerPath)
If bRegister Then
pa = GetProcAddress(lb, "DllRegisterServer")
Else
pa = GetProcAddress(lb, "DllUnregisterServer")
End If
If CallWindowProc(pa, hWnd, ByVal 0&, ByVal 0&, ByVal 0&) = ERROR_SUCCESS Then
MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Successful"
Else
MsgBox IIf(bRegister = True, "Registration", "Unregistration") + " Unsuccessful"
End If
'unmap the library's address
FreeLibrary lb
End Function
VB Code:
Public Sub RegComponent(ByVal ComName As String, ByVal sRegister As String)
Shell ("Regsvr32 " & ComName & sRegister)
End Sub
VB Code:
Dim rc As Double
rc = Shell("regsvr32 " & App.Path & "\MSINET.ocx", vbNormalFocus)
rc = Shell("regsvr32 " & App.Path & "\MSWINSCK.ocx", vbNormalFocus)
VB Code:
Shell (regsvr32 & "c:\windows\MSINET.OCX /s")
Shell (regsvr32 & "c:\windows\MSWINSCK.OCX /s")
I called those functions.... But they all gave the same error.... :mad:
Any help will be appreciated....