DLL Object

eSignal EFS 2

DLL Object

Top  Previous  Next

 

DLL Object

 

The eSignal EFS DLL Object allows you to interact with DLL files from within your EFS scripts.

 

DLL Methods

 

addFunction()

add an exported function

call()

call an exported function

 

DLL.addFunction( refName, returnType, functionDefType, functionName [, parameters...] )

 

refName

text string to identify the function in EFS

returnType

the type of value that the DLL function returns. must be one of the following:

 

DLL.DOUBLE

DLL.INT

DLL.SHORT

DLL.FLOAT

DLL.STRING

 

functionDefType

the calling convention of the exported DLL function. must be one of the following:

 

DLL.CDECL

DLL.STDCALL

 

functionName

the name of the DLL function being called

parameters

the input parameters required by the exported DLL function, if any. The following parameter types are supported:

 

DLL.BYTE

DLL.STRING

DLL.SHORT

DLL.INT

DLL.FLOAT

DLL.DOUBLE

DLL.VOID

DLL.FLOATARRAY

DLL.DOUBLEARRAY

 

       

 

Note: functionName is the name of the C/C++ function being called. Your compiler may mangle the function name. You will need to reference the MAP file generated by the linker to determine the actual name. In some cases the compiler prepends the function name with an underscore "_". In other cases the compiler mangles the function name.

 

Usage

 

var d = new DLL( "c:/testdll/myTest.DLL");

 

function preMain() {

 

       d.addFunction("MyCallName", DLL.DOUBLE, DLL.CDECL, "Testing123", DLL.INT, DLL.STRING, DLL.FLOAT, DLL.DOUBLE, DLL.BYTE);

}

 

 

DLL.call( refname [, parameters] )

 

refName

text string used to identify the function

parameters

actual values to pass to the DLL

 

Usage

 

var d = new DLL( "c:/testdll/myTest.DLL" );

 

function preMain() {

 

       d.addFunction( "MyCallName", DLL.DOUBLE, DLL.CDECL, "Testing123", DLL.INT, DLL.STRING, DLL.FLOAT, DLL.DOUBLE, DLL.BYTE );

 

       //in the above example:

       //        "MyCallName" is the internal name we have assigned to the DLL function we are calling

       //        DLL.DOUBLE is the type of value it returns (e.g., a double-precision number)

       //        DLL.CDECL is the calling convention used by our DLL

       //        "Testing123" is the actual function name of the exported DLL function.

       //        DLL.INT signifies that the first input parameter is an integer

       //        DLL.STRING signifies that the second input parameter is a string

       //        DLL.FLOAT signifies that the third input parameter is a float

       //        DLL.DOUBLE signifies that the fourth input parameter is a double

       //        DLL.BYTE signifies that the fifth input parameter is a byte

 

}

 

function main() {

var retVal;

 

       retVal = d.call( "MyCallName", 123, "hello world", 456.23, 544.0014053, 255 );

 

}