UnloadLibrary Statement

Version 7

 

Unloads a DLL library.

Syntax

UnloadLibrary DllLibrary

Comments

The UnloadLibrary statement unloads a DLL library. The argument is a DLL name symbol that previously inserted under submodule Libraries. The DLL name must be marked as public if the Unload statement is called from external module. The DLL could be any DLL including an ATEasy DLL. When the DLL is unloaded it is removed from the process memory if the DLL reference count is 0 at that point the DLL LibMain (or OnEndSystem/OnEnd events for ATEasy DLL) will be called notifying the DLL that it is about to be unloaded from the memory.

Unloading or Loading a DLL allows the application to switch the modules DLLs implementation with another DLL. This can be useful when creating generic driver that its implementation can be changed by replacing a DLL.

Example

The following example unloads the gxsw32 library:

 

UnloadLibrary gxsw32

The following example unloads gxsw32 DLL of the module MUX:

 

UnloadLibrary MUX.gxsw

 

See Also

LoadLibrary