DLL.CallFunction

string DLL.CallFunction ( 

string Filename,

string FunctionName,

string Parameters = "",

number ReturnType = 0,

number CallConvention = 0 )

Description

Calls a function in a dynamically linked library (DLL). It can be used to extend Setup Factory's functionality with your own functions.

Warning: Calling DLLs is a fairly advanced thing to do and writing DLLs is best done with C or C++. We have tried to provide a large range of functionality with Setup Factory, so there aren't many reasons to use external DLL calls. Make sure that you know exactly what parameters the DLL function you are calling takes. Providing too many or not enough parameters can corrupt the application's memory so please do so at your own risk.

Parameters

Filename

(string) The path to the DLL file.

FunctionName

(string) The name of the function within the DLL.

Parameters

(string) The comma-separated list of parameters that you want to pass to the function.

Note: Place double-quotes around any parameters that you want passed as NULL-terminated string pointers. Only ANSI strings are supported, not Unicode. Parameters without quotes are passed as LONG integers.

If any parameters are strings, you need to escape the double quotes of the parameters. For example, if your parameter is "String 1" and the number 2, your parameter string would be:  "\"String1\", 2"

All parameters are one-way only - they can be passed into the DLL function, but they cannot be evaluated after the function has been called. (In other words, these parameters are pass-by-value, not pass-by-reference.)

ReturnType

(number) The type of value returned from the function:

CONSTANT

VALUE

DESCRIPTION

DLL_RETURN_TYPE_INTEGER

0

Setup Factory will interpret the function's return value as a 16-bit integer (int).

DLL_RETURN_TYPE_LONG

1

Setup Factory will interpret the function's return value as a 32-bit integer (long).

DLL_RETURN_TYPE_STRING

2

Setup Factory will interpret the function's return value as a NULL-terminated string.

Note: If the function doesn't return a value (the function returns void), use DLL_RETURN_TYPE_LONG.

CallConvention

(number) The calling convention that Setup Factory will use when calling the DLL function:

CONSTANT

VALUE

DESCRIPTION

DLL_CALL_CDECL

0

Call the DLL function using the __cdecl calling convention.

DLL_CALL_STDCALL

1

Call the DLL function using the __stdcall calling convention.

Returns

(string) The value that was returned from the DLL function as a result of the function call. If an error occurs, a blank string "" is returned. You can use Application.GetLastError to determine whether this action failed, and why.

ResultVariable

When adding an action with the action editor, you can use this field to specify a variable that the return value will be stored in.

See also:  Related Actions