%DLL_CLOSE

Close a Dynamic Link Library

WSupported on Windows
USupported on Unix

 

NSupported in Synergy .NET
status = %DLL_CLOSE(dll_handle)

status

An integer value of 1 if %DLL_CLOSE is successful. If unsuccessful, the error $ERR_DLLCLSERR is generated. (i)

dll_handle

The handle of the DLL, as returned from %DLL_OPEN. (i4)

The %DLL_CLOSE function closes a DLL that was opened with %DLL_OPEN.

Make sure you close each DLL only once for each DLL_OPEN. If you close a DLL twice in one part of an application, the rest of the application may assume the DLL is still open and available but can no longer access it. This situation will leave the rest of the application in an unstable state. Pay particular attention whenever a system DLL (for example, user32.dll on Windows) is accessed, because the runtime also uses these DLLs.

Each DLL opened by a Synergy application should be closed with %DLL_CLOSE before the Synergy application is exited. If %DLL_CLOSE is not called and the customer does a program chain, the resources are not freed. Calls across program chains can use the same DLL handle.

When the runtime ends, whether normally or abnormally, it automatically closes all open DLLs.

See %DLL_CALL Examples.