Command DLLFUNCTION Foundation
Creates a user-level function which executes a function of an external DLL. The command is deprecated. Use the EXTERN command instead.
DLLFUNCTION <FunctionName>( [[@]<Parameters,...>] ) ;
USING CDECL | OSAPI | STDCALL | SYSTEM ;
FROM <DllName>
Key word | Description |
---|---|
CDECL | C calling convention |
OSAPI *) | Calling convention for the operating system API |
STDCALL | Calling convention for the Windows 32bit API |
SYSTEM | Calling convention for the OS/2 API |
|
The DLLFUNCTION command is used to call functions from 32bit DLL files which are linked dynamically. It allows the utilization of functions within an Xbase++ application which are not known by the linker at the time when the EXE file is created. This includes operating system APIs as well as functions contained in DLLs of 3rd party producers.
The command creates an Xbase++ wrapper function which has the same name as the function contained in the DLL file <DllName>. Therefore, a DLL function can be called on the Xbase++ language level using a symbolic identifier.
When the Xbase++ function is called in a program, it first loads the DLL and then executes the DLL function of the same name. If parameters are declared, the Xbase++ function passes the received arguments to the DLL function. All parameters that are declared with a preceeding reference operator (@) are passed by reference to the DLL function. When the DLL function finishes, the DLL is unloaded and the Xbase++ function returns the return value of the DLL function.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.