In addition to user functions and intrinsic functions, EasyLanguage enables you to use functions residing in DLL's. This means that in addition to all the EasyLanguage reserved words and functions, EasyLanguage can also reference any function written in C or C++.
Using the DLL utility is covered in-depth in the Developer Reference Guide.
EasyLanguage Example:
While the Developers Reference Guide will go into more depth about how to use DLLs with EasyLanguage, the following is an explanation of the syntax and a simple example.
Before you can call a DLL function from EasyLanguage, you must declare the DLL using a DLL Function Declaration statement.
Syntax:
DefineDLLFunc: "DLLNAME.DLL", Return Type, "FunctionName", Parameters;
- DLLNAME.DLL is the name of the DLL where the function resides
- Return Type is the type of expression the function will return
- Function Name is the name of the function as defined in the DLL
- Parameters is the list of parameters expected by the function
|
|
For example, the following statement declares a function called MessageBeep which resides in the DLL called USER32.DLL. It returns a Boolean (true/false) value, and it expects one parameter, int. Example:
DefineDLLFunc: "USER32.DLL", bool ,"MessageBeep", int;
if Open > Close then MessageBeep(0);
Once it is defined using DefineDLLFunc statement, a DLL function can be called from EasyLanguage® in much the same way as any other EasyLanguage® function is used. A DLL function can be called within an expression or as a distinct statement if the return value is not used. |