AMT Help Files

Call external DLL

Syntax Color Legend
Command
Mandatory parameter
Optional parameter
Mandatory keyword
Optional keyword

Syntax

CALL (<Procedure>, <Library>[, <Dlltype>])

Description

Accesses routines in an external DLL library.

Diagram

Returned value type

None

Parameters

Parameter Description
<Procedure> Expression that specifies the procedure name.
<Library> Expression that specifies the name of the dynamic link library in which the procedure can be found.

Remarks

The system item SI-PARAM can be used to pass parameters to the routine and receive results.

The status of the CALL command is stored in the system item GETLASTRESULT. If the CALL is executed successfully, GETLASTRESULT is empty. A more detailed explanation of the use of external libraries can be found in Using External DLLs.
When the external library is written in C# and compiled using .NET, the class name of the function (procedure) should be included in the <Procedure> description. See Adding your own external .dll.

By default, the library is called by the same .NET version that runs AMT. To call the library with an older .NET version, the library must be added to either the Sys.ini parameter AMTCALLDLLNET48 or AMTCALLDLL. See Configuring Sys.ini.

Example

si-param := 'This is input for the DLL.'
call ('TestCall.CallHello', 'CallTest.dll')

if getlastresult = ''
  sme ('result: ', si-param)
else
  sme ('Error in dll CallTest!')
endif

Contents