|
|
|
|
- Loading and unloading the DLL
LoadDLL (Function) In french: ChargeDLL Loads the specified library (DLL) in memory. A 32-bit application can load a 32-bit library, a 64-bit application can load a 64-bit library. This library will be loaded in memory until: - the application ends,
- FreeDLL is run.
hInst is system int hInst = LoadDLL("MyDLL.DLL") IF hInst = 0 THEN Error(ErrorInfo()) ELSE Info("DLL loaded") FreeDLL(hInst) END
hInst is system int hInst = LoadDLL("MyDLL.DLL") IF hInst = 0 THEN Error("Error during the unload operation") ELSE CallDLL32("MyDLL", "FunctionA", par1, par2) CallDLL32("MyDLL", "FunctionB", par1) FreeDLL(hInst) END
Syntax
<Result> = LoadDLL(<DLL name>)
<Result>: System integer - Instance of loaded DLL,
- 0 if an error occurs. To get more details on the error, use ErrorInfo.
<DLL name>: Character string Name of library (DLL) to load. This name can be a full name or a relative name but the extension (.DLL in most cases) must be specified. If this parameter corresponds to a relative name, the library will be sought: 1. In the directory where the executable corresponding to the current process is found. 2. In the current directory. 3. In the system directory of Windows. In most cases, "C:\Windows\System" (98) or "C:\Winnt\System32" (NT/2000). 4. In the Windows directory. 5. In the directories specified in PATH. Remarks Loading and unloading the DLL CallDLL32 automatically loads the DLL if necessary, then unloads it (if it was loaded). This mechanism can be quite slow, except for the system DLLs (KERNEL, USER, GDI). To optimize the execution speed, we advise you to load the DLL once with LoadDLL and to unload it with FreeDLL when the DLL is no longer used.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|