Results 1 to 4 of 4

Thread: Registering ocx

  1. #1
    Guest
    I have some workstations that will register and some that dont. It seems that there is somthing missing from the workststion like a dll.

    I used the following code..

    Option Explicit
    Private Declare Function DllRegisterServer Lib "nwdir.ocx" () As Long
    Private Declare Function DllUnregisterServer Lib "nwdir.ocx" () As Long
    Const ERROR_SUCCESS = &H0


    Private Sub Command1_Click()
    If DllRegisterServer = ERROR_SUCCESS Then
    MsgBox "Registration Successful"
    Else
    MsgBox "Registration Unsuccessful"
    End If

    End Sub

    Private Sub Command2_Click()
    If DllUnregisterServer = ERROR_SUCCESS Then
    MsgBox "UnRegistration Successful"
    Else
    MsgBox "UnRegistration Unsuccessful"
    End If

    End Sub

    On the machines that will not register I get a runtime error 48 but on other machines it works fine. The ocx is in the system dir. Mix of win95 and win98

  2. #2
    Guest
    In order for the DllRegisterServer and DllUnregisterServer api function to work, you have to have regsvr32.exe on your computer, hopefully in the C:\Windows\System directory.

    Perhaps some of the workstations are missing that file?

  3. #3
    Guest

    Talking Bingo! I found the problem...

    Out of date mfc42.dll. Thanks for the help though.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Matthew - you don't need to have regsvr32.exe...the functions are both stored in the .ocx file.

    All that regsvr32.exe does is to call either of those functions.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width