Click to See Complete Forum and Search --> : DLLs Unload


ssankar
September 20th, 2005, 02:29 PM
Hi,

I would like to unload one of the dllS loaded by VC++ studio while initializing the process. How do I unload that DLL. I tried GeModuleName() and FreeLibrary. But it doesn't work. Then I am trying to load same DLL from other location( Diff Version) using LoadLibrary based on some condition. Am I missing something? Your help is greatly appreciated.

Thanks
Sankar S

olivthill
September 20th, 2005, 04:05 PM
FreeLibrary() is decreasing the usage count, and if it reaches zero, and after a certain amount of time, the DLL is unloaded. See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_programming/debugging.asp where it is said
Unloading the DLL
The Shell automatically unloads a DLL when its usage count is zero, but only after the DLL has not been used for a period of time. This inactive period might be unacceptably long at times, especially when a Shell extension DLL is being debugged. For operating systems prior to Windows 2000, you can shorten the inactive period by adding the following information to the registry.

HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Explorer/AlwaysUnloadDllSee also http://blogs.msdn.com/mgrier/archive/2005/06/18/430522.aspx.