Executes the specified method in a dynamic-link library (DLL) and stores the return value of the method in a variable.
|
Incorrect usage of this action can cause the task to fail or act erratically. Caution should be exercised when calling functions in this manner. |
Declaration
<AMEXECUTEDLLFUNCTION DLLFILEPATH="text" METHODENAME="text" RETURNTYPE="text" RESULTVARIABLE="text [variable name]" />
Example
Execute DLL function "%AMTrigger.Value%" from "%AMTrigger.TaskLate%". Return type is "Single". Place the return value into variable "newvariable".
<AMEXECUTEDLLFUNCTION DLLFILEPATH="%AMTrigger.TaskLate%" METHODENAME="%AMTrigger.Value%" RETURNTYPE="Single" RESULTVARIABLE="newvariable" />
To set Execute DLL Function Properties:
In the Available Actions pane, open the Advanced folder and double-click the Execute DLL Function action or drag it into the Steps pane. The Action Properties dialog box appears.
In the Dynamic-link library field, enter the name of the library to use. Use the icons to the right of the field to use the Expression Builder or to browse to a specific location.
In the Method Name field, enter the name of the method you want to execute.
In the Method return value type dropdown, select a return value type.
In the Variable to populate with return value, enter a variable name.
In the Arguments tab, select the type of argument you want to assign a value to from the dropdown.
Click the Add button when you are ready to add the value to the argument list.
To set the Description tab properties, please refer to Description Tab Options.
To set the Error Causes and On Error tab properties, please refer to Step Error Handling.
When finished, click OK to save settings.
See Also
BASIC Script, List Environment Variables, Set Environment Variable, Append Environment Variable, Delete Environment Variable, Get Environment Variable
Property |
Type |
Required |
Default |
Markup |
Description |
Dynamic-link library |
Text |
Yes |
(Empty) |
DLLFILEPATH= "newlib.dll" |
Specifies the DLL to perform the action on. Click the Folder icon to navigate to the appropriate DLL file. Thereafter, click Go to populate the Type (for managed DLL), Method Name and Method Return Value fields with the queried values. |
Type (managed dll) |
Text |
Yes |
(Empty) |
TYPE="newlib.dll" |
Specifies the DLL class which contains the available methods. After specifying a DLL file in the Dynamic-link library parameter, clicking Go 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 |
No |
Yes |
UNLOADDLL="NO" |
If set to YES, 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, the DLL will not be unloaded until the task has completed (either successfully or unsuccessfully). |
Method Name |
Text |
Yes |
(Empty) |
METHODENAME="name" |
Indicates 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 Options |
Yes |
(Empty) |
RETURNTYPE="void" |
Specifies the type of the return value for the method. The available options are:
|
Variable to populate with return value |
Text |
Yes |
(Empty) |
RESULTVARIABLE= "myVar" |
Specifies the name of an existing variable to be populated with the return value of the selected method. |
Create return complex type structure |
Text |
No |
(Empty) |
RESULTSTRUCTURE= "structname" |
Specifies the name of the structure created by the user. |
Property |
Type |
Required |
Default |
Markup |
Description |
Type |
Text Options |
No |
(Empty) |
ArgType="Int16" |
Allows you to select the type of argument you want to assign and its value. The available drop-down options are:
|
Value |
Text |
No |
(Empty) |
ArgValue="theValue" |
Allows you to assign a value to the argument. Click Add then enter a value to the argument list. Other options:
|
The Description tab allows you to customize the text description of any step when it appears in the Steps Pane.
More on setting custom step description
The Error Causes tab is part of AWE's Error Handling functionality which allows you to select / omit specific errors that will cause a particular step to fail.
More about error causes properties
The On Error tab is part of AWE's Error Handling functionality which allows you to determine what the task should do if a particular step encounters an error.
More about On Error properties
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.