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
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
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.
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.
How to import a .DLL at runtime?
magicman
Nick Rawe
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
I found an answer here:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=950987&SiteID=1
Jeff Waz
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
RRRSr
Please note that I am quite the noob at VB.Net so make the code easy!