CallCFunction()

Syntax

Result = CallCFunction(#Library, FunctionName$ [,Parameter1 [, Parameter2...]])
Description
Calls a function, in the specified library, in such a manner that the parameters are handled in the same fashion as a normal 'C' language function. The library must have previously been opened with the OpenLibrary() function. The function from the DLL is called by using that functions name. If the function is described as 'cdecl' then this function must be used. However, most DLLs used within the Microsoft Windows OS do not use this form, so CallFunction() should be sufficient in most cases.

Any number of parameters may be specified, but the number of these specified parameters, must be identical to the number of parameters required by the function. For example, if a function requires 2 parameters, then 2 parameters must be passed, even if these 2 values are null.
Note: Currently the maximum number of parameters is 20.

Parameters

#Library - The number of the library from which the function will be called. This number must be identical to that used previously with: OpenLibrary().

FunctionName$ - A string containing the name of the function to be called.

Parameter1, Parameter2, ... - The parameters for the function to be called. The number of these parameters, must be identical to the number of parameters required by the function, as described in the developer documentation for that library.

Return value

Result - The result of the library function which has been called.

Note: This function is not very flexible and does not handle string/float/double/quad parameters or string/float/double/quad returns. The use of: prototypes is now strongly recommended.

Supported OS

All

Library Index - CallCFunctionFast() ->