Results 1 to 5 of 5

Thread: [RESOLVED] Load .dll at RunTime

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Resolved [RESOLVED] Load .dll at RunTime

    Hello,

    Say i have a compule of dlls with a simle function.

    Now i know i need to add a reference to the dll in order to use it, but i dont know which dll to use until the program is run and user does something.

    So how can i load a dll at runtime.. ?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Load .dll at RunTime

    ActiveX DLL can be used without referencing them if you use late bindings. It's less effective but works.
    VB Code:
    1. Dim obj As Object
    2. Set obj = CreateObject("[i]ProjectName.ClassName[/i]")

  3. #3

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Load .dll at RunTime

    Hi there,

    this is not working...

    say i compiled the activex dll to MyDll.dll and its placed in app.path & "\extra\"

    a folder called Extra in my app.path.

    So dont i need to specify the path of the dll?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Load .dll at RunTime

    No, you don't need to specify the path to an ActiveX DLL. However the DLL needs to be registered on the computer. On your computer VB will register it automatically. You can register a DLL manually using the RegSvr32.exe program but normally you would create a setup package which will install and register the DLL. The normal location of the file is in the System32 folder (or System on Win9x/Me).

  5. #5
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: [RESOLVED] Load .dll at RunTime

    What you mean is a plugin?
    With some API's you can register/unregister a *.dll (Active-X) at runtime. In case of plugins be careful to name all the class names equal.

    First register with the Regserver class and then:
    [vb]
    Set Plugin= CreateObject("Projectname.ClassName")
    [/vb]
    Attached Files Attached Files

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