Load a Dynamic-Link Library

$load_dll node dllno dllpath [varname]

This command is used to specify and pre-load a dynamic link library which will be used to perform special application tasks. Up to 8 DLLs can be pre-loaded, and each can have any number of entry points. Entry points must be defined with a single null-terminated string argument and the DLL function must return an integer value. The DLL number is selected at run-time using the special system variable DLL_SELECT and the parameter is passed as DLL_PARM, with the result in DLL_RETURN. For examples of DLL calls, see Using Dynamic Link Libraries.

The parameters on this command are used as follows:

node the nodename of the machine which is to load this DLL, or * for all nodes.
dllno the number between 1 and 8 inclusive which is to be assigned to the DLL. A letter 'C' may also be used to specify the "call control DLL" used to validate and control inbound calls.  A numeric DLL number may have a suffix of 'A' to indicate that the parameters to the DLL will be passed in system default encoding, or a suffix of U to indicate that the paramters will be passed in Unicode (wide chars). The default is that parameters are encoded UTF-8, and this is always the case with the call control DLL.
dllpath the full pathname of the DLL if it is not on your Windows path, or the filename and extension if it is on your path. The .DLL extension is required.
varnamea variable to which the dllno number (or 'C') will be assigned. This variable can be used in the infobox which calls the DLL in place of the DLL number, to improve maintainability of your application.

The DLL files are loaded when COPIAFACTS starts. If you wish to replace a file you must shut down COPIAFACTS before you can do so.


Load DLL number 4 on machine M1 only:

$load_dll M1 4 CDLL.DLL

Reference the above DLL in an infobox file:

$set_var DLL_SELECT 4

Load DLL number 4 on all machines and assign its number to a variable:

$load_dll * 4 CDLL.DLL MYDLL

Reference the above DLL in an infobox file: either of:

$set_var DLL_SELECT 4