Windows DLL & APIs

In Windows EPL Application, you can call functions of Windows Dynamic Link Library (Dll). You must declare it before your calling.

Declare DLL Function

To add a new Dll function, click “Insert” ->”DLL Function” menu.

EPL

A dll function must contain these attributes below

 

Dll Function Name

Defines the name that will use in application of the dll function.

 

Return Type

Defines the data type for the return value of the dll function, can only be empty, Byte, Short, Integer, Boolean, and String type

 

Dll File Name

Defines the file name of Dynamic Link Library that the dll function locates in. If haven’t specified any file name, the system will search the specified function in Kernel32.dll, GDI32.dll, User32.dll, Mpr.dll, Advapi32.dll and other Windows Basic Provided Dlls of APIs.

 

Function Name in Dll

Defines the function name in dll for the current function, if not specify this, the system will use the same name of current function.

DLL function parameter must contain these attributes below

Attribute Description
Data Type The data type of parameter must be same as parameter of specified Dll functions. You can use all the data type except String Array, Bin Array, also can use Library-Defined or User-Defined data type.
ByRef Set this attribute to True if the parameter of function need passing in variable address. If parameter’s type is array, string, bin, user-defined data type, library-defined data type, it will pass to variable address into dll function whatever this attribute is True or not.
Array Same as function array-parameter, see Function chapter

The following shows you some examples that to declare a same Windows API by C++ & EPL.

 

MoveWindow

In C++ originally

BOOL MoveWindow (HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint);

In EPL

EPL

 

CreateThread

In C++ originally

HANDLE CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, DWORD dwStackSize,LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);

In EPL

EPL

 

Using DLL Function

You can call the pre-declared DLL functions in any code-able place of your application. To call the dll function, just same as call common functions.

Win32 data type & EPL data type conversion

EPL includes various data types, basically all the Win32 data types is compatible with EPL data type. Please see the data type conversion relationship list below

Win32 Data Type EPL Data Type
BOOL Integer
BSTR String
BYTE Byte
COLORREF Integer
DWORD Integer
LONG Integer
LPARAM Integer
LPCSTR String
LPSTR String
LPCTSTR String
LPTSTR String
LPVOID Integer
LRESULT Integer
UINT Integer
WNDPROC FunctionAddress
WORD Short
WPARAM Integer