UnUseDLL

InstallShield 2014 ยป InstallScript Language Reference

The UnUseDLL function unloads a .dll file from memory. UnUseDLL decrements the lock count of the .dll file by one. When the lock count equals zero, InstallShield unloads the .dll file. Every call to UseDLL should have a matching call to UnUseDLL so that .dll files are not left in memory after they are no longer needed, using system resources. After you unload a .dll file, you cannot call the functions in that .dll file.

If the script exits or terminates before properly unloading the .dll file with UnUseDLL, the .dll file is locked in memory. If you attempt to access the .dll file again, your script might fail. You must remove the .dll file from memory by restarting Windows.

Caution: Microsoft Windows system .dll files, such as User.exe, User32.dll, Gdi.exe, Gdi32.dll, Krnl386.exe, Krnl286.exe, and Kernel32.dll, are loaded and unloaded automatically by Windows. Do not call UseDLL and UnUseDLL to load and unload these .dll files.

Syntax

UnUseDLL ( szDLLName );

Parameters

UnUseDLL Parameters

Parameter

Description

szDLLName

Specifies the file name of the .dll file. Do not include the path in this parameter.

Return Values

UnUseDLL Return Values

Return Value

Description

0

Indicates that the function successfully unlocked and possibly unloaded the .dll file from memory.

< 0

Indicates that the function was unable to unlock or unload the .dll file.

See Also