help with a small problem
-
i have made a small application that can load programs compiled into dll files, i managed to get the application to load my dll files correctly but now i am having issues with how to unload the dll files correctly. inside the dll program, when i go to close the program i can not use the normal means to close as it would cause the whole program including the loader to close. so if someone could please give some advice on how to properly unload a dll after its loaded, it would be very much appreciated.
-
i have made a small application that can load programs compiled into dll files, i managed to get the application to load my dll files correctly but now i am having issues with how to unload the dll files correctly. inside the dll program, when i go to close the program i can not use the normal means to close as it would cause the whole program including the loader to close. so if someone could please give some advice on how to properly unload a dll after its loaded, it would be very much appreciated.
If you load your dlls dynamically, you can unload them. If they are referenced by your project at build time, they will be loaded for the lifetime of your app instance.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
i have made a small application that can load programs compiled into dll files, i managed to get the application to load my dll files correctly but now i am having issues with how to unload the dll files correctly. inside the dll program, when i go to close the program i can not use the normal means to close as it would cause the whole program including the loader to close. so if someone could please give some advice on how to properly unload a dll after its loaded, it would be very much appreciated.
Your question is not clear. Are you saying you want to unload a DLL or are you saying calling Environment.Exit() from a dynamically loaded DLL doesn't work? If it's the former, feel free to browse Google[^] If it's the latter, there's little anybody can do without your code. FYI, I loaded an assembly using
Assembly.Load
, instantiated a type and called a method on it which calledEnvironment.Exit()
and the app was cleanly shut down. Again, you may want to post a code snapshot.Cheers, Vıkram.
Be yourself, no matter what they say. - Sting, Englishman in New York.