(Contents)(Previous)(Next)

Unloading Dynamic Link Libraries on Program Termination

Many programs load and use dynamic link libraries (DLL) during their execution. If these programs get terminated prematurely or even normally, the DLL might remain loaded in memory. When developing DLLs this causes a problem, because the compiler and linker will not be able to write the new version if the DLL to the disk, since the old version of the DLL is still in use.

Under Windows 95, you can make the Explorer unload the DLLs after the termination of the program by setting a key in the Registry. Editing the Registry should be done only by experienced users and with extreme care and the Registry should always be exported or backed up before any changes are made.

1. Start the REGEDIT.EXE program.

2. Go to the key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Explorer

3. Click the right mouse button in the open area of the right panel and select the New String item from the menu.

4. Type AlwaysUnloadDll exactly for name of the new key entry and press the Enter key.

5. Double click the new key entry to open the Edit String dialog box and enter a value from 1.

You can also unload DLLs by shutting down and restarting the Explorer. The easiest way to do this is to log off and log on as a different user, if network extensions or different user profiles are enabled.


(Next)