background image
<< Calling Windows DLLs From 4Test Scripts | Calling DLL Using DLL support files installed with SilkTest >>
Calling DLL Aliasing a DLL name
<< Calling Windows DLLs From 4Test Scripts | Calling DLL Using DLL support files installed with SilkTest >>
426
User's Guide
24 C
ALLING
W
INDOWS
DLL
S
F
ROM
4T
EST
S
CRIPTS
Aliasing a DLL name
dllname
The name of the dll file that contains the functions you want to
call from your 4Test scripts.
prototype
A function prototype of a DLL function you want to call.
Prototype syntax
A function prototype has this form:
return-type func-name ( [arg-list] )
return-type The data type of the return value, if there is one.
func-name
An identifier that specifies the name of the function.
arg-list
A list of the arguments passed to the function, specified as
follows:
[pass-mode] data-type identifier
pass-mode
Specifies whether the argument is passed into the function (in),
passed out of the function (out), or both (inout). If omitted, in
is the default.
To pass by value, make a function parameter an in parameter.
To pass by reference, use an out parameter if you only want to
set the parameter's value; use an inout parameter if you want to
get the parameter's value and have the function change the
value and pass the new value out.
data-type
The data type of the argument.
identifier
The name of the argument.
Limitation
You can call DLL functions from 4Test scripts, but you cannot call member
functions in a DLL.
Aliasing a DLL name
If a DLL function has the same name as a 4Test reserved word, or the
function does not have a name but an ordinal number, you need to rename the
function within your 4Test declaration and use the 4Test alias statement to
map the declared name to the actual name.
For example, the exit statement is reserved by the 4Test compiler. Therefore,
to call a function named exit, you need to declare it with another name, and
add an alias statement, as shown here:
dll "mydll.dll"
my_exit ()
alias exit