How to import a .DLL at runtime?

How do I import a library contained within a .DLL file at runtime, given its path Is this even possible in VB.Net 2005 Express



Answer this question

How to import a .DLL at runtime?

  • magicman

    Thanks for all your help guys, but I think I'm just gonna pay for more bandwidth and forget moduralizing my code into DLLs!


  • Nick Rawe

    Any DLL you make in VB.NET or any other .NET language is a managed one.

  • Juerg

    I've come up with this same problem again in a different context:

    I'm now making an apple-dashboard style widgets program for windows using VB. The widgets are saved as DLLs, and the user must be able to import new ones at runtime. I've worked out how the DLLs and the widgets software would work, but how do I make an instance of a class stored in a DLL, at runtime



  • WiKoPL

    If your writing code that is using the functionality - is there any reason why you cant simply add the reference to your code at design time


  • JGrove805

  • Jeff Waz

    Well you see I am making an MMORPG that will need to automatically update itself on the client's computer. To save bandwith, I am moduralizing the graphics library, etc. onto DLL files, so that they are only re-downloaded when they have been updated.

    Therefore, if I were to import the library at design time, then modify it later on, would the application still function, ot would I need to import it at run-time


  • AndrewMurdock

    Do you mean a managed or unmanaged dll

    If a managed one you can simply load the Assembly with one of the many load functions provided by the assembly class.

    If on the other hand you mean an unmanaged dll this gets a little tricky as you would need to know the name of the dll, the name of the function(s) you want to call and their complete signatures at compile time for a proper P/Invoke... otherwise you are more or less out of luck.



  • Mian Fahim ul Haq

    Well I think I found what you're looking for at suppor.microsoft

    How to call a managed DLL from native Visual C++ code in Visual Studio.NET or in Visual Studio 2005

    http://support.microsoft.com/kb/828736/en-us

    I think you dont need to register the dll since both client and dll are managed. Someone correct me if I'm wrong.

    Regards.


  • isaacc

    You don't register it with regsrvr32. If you want a DLL of managed code to be COM visible then you would use regasm to register and make a type liberary. From there VB6 can excute .Net Code.



  • DadoToday

    I'm not sure if the DLL is managed or unmanaged. Is a DLL that I make using VB.NET 2005 Managed or Unmanaged


  • RRRSr

    Thanks. How do I load the DLL at runtime then, given the path, and given that it is managed

    Please note that I am quite the noob at VB.Net so make the code easy!


  • How to import a .DLL at runtime?