Results 1 to 9 of 9

Thread: Short and sweat

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    How do i use Regsvr32.exe at run time???

  2. #2
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    Shell "Regsrv32.exe /r blah.dll", vbNormalFocus

    r0ach™
    Don't forget to rate the post

  3. #3
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Talking How about this...

    New Project:
    Form
    Name = frmMain
    Caption = "r0ach"
    CheckBox
    Name = chkReg
    Value = vbChecked
    Caption = "Register"

    Code:
        Private Sub Form_Load()
            Me.OleDropMode = 1
        End Sub
    
        Private Sub Form_OLEDragDrop(Data As DataObject, _
                                     Effect As Long, _
                                     Button As Integer, _
                                     Shift As Integer, _
                                     X As Single, _
                                     Y As Single)
            If chkReg.Value = vbChecked Then
                If Shell("Regsvr32.exe " & Data.Files(1), vbHide) then
                    MsgBox Data.Files(1) & " was registered successfully"
                Else
                    MsgBox Data.Files(1) & " was not registered"
                End If
            Else
                If Shell("Regsvr32.exe /u " & Data.Files(1), vbHide) then
                    MsgBox Data.Files(1) & " was unregistered successfully"
                Else
                    MsgBox Data.Files(1) & " was not unregistered"
                End If
            End If
        End Sub

    r0ach™
    Don't forget to rate the post

  4. #4

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    cool

    but what is DataObject, is it a type

    data.files(1)->????????????

  5. #5

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Talking ok

    it ok i figure it out

    Thank a lot for the code

    Can i register .ocx(active x) with it to??

  6. #6

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    hummmmm!

    Ok i did a test to unregister and then register it back and it gave that error both time:.........dll was loaded, but then DllRegisterServer entry point was not found.

    DllRegisterServer may not be exported or a corrup version of ........dll may be in memory.

    What the problem!

  7. #7
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    I believe so. I'm not sure though.

    r0ach™
    Don't forget to rate the post

  8. #8
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722
    I tested it, and got the same error. But according to the msgboxes, it registered and unregistered.

    lemme check something...

    OK. Try this:

    Code:
    Private Sub Form_Load()
        Me.OleDropMode = 1
    End Sub
    
    Private Sub Form_OLEDragDrop(Data As DataObject, _
                                 Effect As Long, _
                                 Button As Integer, _
                                 Shift As Integer, _
                                 X As Single, _
                                 Y As Single)
        If chkReg.Value = vbChecked Then
            On Error Resume Next
            Shell "Regsvr32.exe /s " & Data.Files(1), vbNormal
            If Err = 0 Then
                MsgBox Data.Files(1) & " was registered successfully"
            Else
                MsgBox Data.Files(1) & " was not registered"
            End If
            On Error GoTo 0
        Else
            On Error Resume Next
            Shell "Regsvr32.exe /u /s " & Data.Files(1), vbNormal
            If Err = 0 Then
                MsgBox Data.Files(1) & " was unregistered successfully"
            Else
                MsgBox Data.Files(1) & " was not unregistered"
            End If
            On Error GoTo 0
        End If
    End Sub

    r0ach™
    Don't forget to rate the post

  9. #9

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    You got it

    Now it work, what was wrong, is it the parameters that you (/u, /s).So i put all my dll on the other computer and then i make a loop to register all the dll that i've copied.
    ??

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