Results 1 to 7 of 7

Thread: How do I register a DLL from VB?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    How do I do that? I'm building an auto update feature for my program, and after download, the dll's must be registered. I could use a shell command to use regsvr32 but then I'd get those darn "DLL registered successfully" messages.
    What I would need is some function where you'd supply the full path and name of the DLL to register it, since I can't know now what all the dll's will be called.

    //Anders

  2. #2

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    Ok, but I don't know the names of the variables on forehand. Will it work to replace the "MyDll.Dll" thingies with variables? I'm not that good with API's... yet.

    //Anders

  4. #4
    Guest
    Yeah, you just replace "MyDll.Dll" with the Dll that you want to register.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    Hmm, not exactly what I meant. I'll explain further.
    When compiling the program, I don't know the names of the DLL's to be registered. I tried substituting the "MyDll.dll" for a variable but that doesn't work.
    Do you understand what I mean? English is nit my first language...

    //Anders

  6. #6
    Guest
    I think I understand..you want to register a bunch of Dlls?

    You can use RegSvr32.exe and make it silent so that there are no messages.

    Here are its options:

    Code:
    Usage:  regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname
    /u - Unregister server
    /s - Silent; display no message boxes
    /c - Console output
    /i - Call Dllinstall passing it an optional [cmdline]; when used /u calls dll unistall
    /n - do not call DllRegisterServer; this option must be used with /i
    And shell it:

    Code:
    Shell "regsvr32 /s "C:\Windows\System\Mydll.dll", vbHide
    To list all dlls from the Window\System folder:

    Code:
    Dim FileFinder
    FileFinder = Dir("C:\Windows\System\*.dll")
    Do Until FileFinder = ""
    List1.AddItem LCase(FileFinder)
    FileFinder = Dir
    Loop

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    Lovely! That's what I need. Thanks!

    //Anders

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