Best way to end a form
-
Hi all, I have a problem. I have 1 exe and several dll's. From my exe (mostly an MDI form) I call to the different dll's which contain mainly forms. When I want to close such a form, what's the best method 'Close()' or 'Dispose()'. You see, I want to be sure that the complete dll is removed from memory each time, since it is called by 'objAssembly.CreateInstance'... Greetings, Sigurd
-
Hi all, I have a problem. I have 1 exe and several dll's. From my exe (mostly an MDI form) I call to the different dll's which contain mainly forms. When I want to close such a form, what's the best method 'Close()' or 'Dispose()'. You see, I want to be sure that the complete dll is removed from memory each time, since it is called by 'objAssembly.CreateInstance'... Greetings, Sigurd
Someone correct me if I'm wrong here: If you didn't explicitly call the Win32 API function LoadLibrary(), you can't unload it. DLL load and unload is handled automatically by the runtime (in both VB and VB.NET.) When your App loads, the runtime attempts to resolve all external references and loads the appropriate DLL's automatically. Then your app is able to call the functions you wanted. When you're done using the resources of the DLL, it WILL NOT unload. This won't happen (automatically, anyway) until your Application quits because that's when your releasing your references to the DLL. RageInTheMachine9532