Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Networks on April 16, 2005, 01:38 PM

Title: Unloading and Loading Plugins
Post by: Networks on April 16, 2005, 01:38 PM
I am loading plugins in Visual Basic. What I want to be able to do is to have a plugin load automatically or not. Next I want to be able to load and unload that plugin on the user's demand and hold this object in an array. My trouble comes when I unload the plugin. When I unload the plugin is terminates but when I load and unload it again it does not terminate and I delete it from the array list. What may be the reason for this? It unloads once but not again even after re-loading it.

Edit: Perhaps the better question is how do you load and unload plugins properly?
Title: Re: Unloading and Loading Plugins
Post by: Banana fanna fo fanna on April 17, 2005, 01:40 PM
Set yourplugin = Nothing
Title: Re: Unloading and Loading Plugins
Post by: Networks on April 17, 2005, 01:42 PM
I did that prior to posting, it did not work.

I set it to nothing and than I remove it from the array. It works the first time. I think I figured out that the problem lies in loading the plugin again as the classes's initialize method does not call.
Title: Re: Unloading and Loading Plugins
Post by: The-FooL on April 17, 2005, 05:16 PM
Make sure you don't reference the plugin anywhere else.
Title: Re: Unloading and Loading Plugins
Post by: Networks on April 17, 2005, 06:00 PM
Reloading it from the menu works fine, I am content with just that.

Edit: I got it working, I was right it had something to do with the loading of it. I just copy and pasted what I did to load it for the inbot command and adjusted here and there and it works fine now.