Execute DLL Function Action

Declaration

<AMEXECUTEDLLFUNCTION DLLFILEPATH="text" METHODENAME="text" RETURNTYPE="text" RESULTVARIABLE="text [variable name]" />

See Also

 

Execute DLL Function Action-Setting Properties, DDE Action,

Description

Executes the specified method in a managed or unmanaged dynamic-link library (DLL) and stores the return value of the method in an AutoMate variable.

Practical Usage

See description.

Parameters

General Tab

Dynamic-link library

Text, Required
MARKUP: DLLFILEPATH="newlib.dll"

Specifies the specific DLL to perform the action on. Click the Folder icon to navigate to the appropriate DLL file. Thereafter, click the Go button to populate the Type (for managed DLL), Method Name and Method Return Value fields with the queried values.

Type (managed dll)

Text, Required
MARKUP: TYPE="newlib.dll"

Specifies the DLL class which contains the available methods. After specifying a DLL file in the Dynamic-link library parameter, clicking the Go button will attempt to query available DLL types. Upon a successful query, all discovered types will be populated into this field. Clicking the down arrow corresponding to this field will display a full list of queried type names in which to select from.  

NOTE: This option is available only for managed DLLs.

Unload DLL after execution

YES/NO, Optional - default "YES"
MARKUP: UNLOADDLL="NO"

Enabling this option allows the DLL in use to be unloaded (so it is accessible to other programs or system resources) directly after this action is executed. If this option is disabled, (or un-checked) the DLL will not be unloaded until the task has completed (either successfully or unsuccessfully).

Method Name

Text, Required
MARKUP:METHODENAME="name"

Specifies the DLL method (or operation) to invoke. Upon selection of an available class as specified under the Type parameter, all discovered methods relating to that class will be populated into this field. Clicking the down arrow corresponding to this field will display a full list of queried method names in which to select from.

Method return value type

Text, Optional  
MARKUP: RETURNTYPE="void"

Specifies the type of the return value for the method. The available options are:

Variable to populate with return value

Text, Optional
MARKUP: RESULTVARIABLE="new variable name"

Specifies the name of an existing variable to be populated with the return value of the selected method.

Create return complex type structure

Text, Optional
MARKUP: RESULTSTRUCTURE="name"

Specifies the name of the structure created by the user.

Arguments Tab

Type

Allows you to select the type of argument you want to assign and value to. Select from the drop-down.

The available options are:

Value

Allows you to assign a value to the argument. Click the Add button when you are ready to add the value to the argument list.

Move up

Allows you to move the argument up the argument list.

Move down

Allows you to move the argument down the argument list.

Add

Allows you to add and new argument type and value.

Modify

Allows you to edit an existing argument.

Remove

Allows you to delete an existing argument.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMEXECUTEDLLFUNCTION DLLFILEPATH="%AMTrigger.TaskLate%" METHODENAME="%AMTrigger.Value%" RETURNTYPE="Single" RESULTVARIABLE="newvariable" />