FreeDll Command

Purpose

releases a DLL (dynamic link library)

Syntax

FreeDll filename$

Description

FreeDll explicitly releases a DLL from memory. The argument filename$ should be exactly the same as the DLL name specified in the Declare statement. Filename$ may contain a path.

Example

Declare FunctionA WNetAddConnection Lib "mpr.dll" (ByVal lpszNetPath As String, ByVal lpszPassword As String, ByVal lpszLocalName As String) As Long

// Use Dll

// release DLL

FreeDll "mpr.dll"

Remarks

When a DLL function is invoked after its DLL has been released, the DLL is reloaded. This due to the nature of Declare, which instructs the compiler to generate code to check for a valid DLL before calling a DLL function.

See Also

Declare

{Created by Sjouke Hamstra; Last updated: 07/10/2014 by James Gaite}