Results 1 to 5 of 5

Thread: Import DLL manually

  1. #1

    Thread Starter
    Junior Member ApDev's Avatar
    Join Date
    Nov 2011
    Location
    Madrid
    Posts
    23

    Import DLL manually

    Hi people !!

    Well... I'm developing an application and I need to know how I can to import a DLL with code and not with "Add reference" because path will be change when I connect to other computer.

    The library I need to import is ADOX but Maybe it will be used by me with another dlls

    Thanks for y'all!!
    ~ ApDev

  2. #2
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Import DLL manually

    If you create windows application, you can add that DLL file while creating setup and deployment. You can use anywhere. DLL will be inbuilt with you Setup file. (Only in Windows application)

  3. #3

    Thread Starter
    Junior Member ApDev's Avatar
    Join Date
    Nov 2011
    Location
    Madrid
    Posts
    23

    Re: Import DLL manually

    Well... I don't know it, but I don't want to make a setup because I want that my application will be portable

    Although I will try it

    Thanks !!!
    ~ ApDev

  4. #4
    Lively Member
    Join Date
    Jul 2010
    Posts
    66

    Re: Import DLL manually

    for portable, you can keep that DLL file in BIN folder. Use the code to read the path from computer, where you going to use.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Import DLL manually

    You're going about this all wrong. ADOX is a COM library and it's part of Windows. You absolutely do NOT need to load it dynamically. You MUST reference it at design time, no question. You don't have to care where the library is. It's a registered COM component, so it will always be accessible.

    When you reference a COM component or ActiveX control, an Interop DLL will be created. It is a .NET assembly that provides the bridge between the managed code of your app and the unmanaged code of the COM component, allowing them to INTEROPerate. That DLL must be deployed with your EXE and placed in the same folder. That's it, that's all.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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