ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous Windows functions
  • Loading and unloading the DLL
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
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.
Linux Loads the specified .so library in memory.
Example
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.
Linux Name of .so library to load.
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.
Component: wd290vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo
https://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/3763-windev-desenvolvendo-dll-assembler-net-32-64-usando/read.awp
Boller
01 Jun. 2021

Last update: 05/26/2022

Send a report | Local help