background image
<< Calling DLL Using DLL support files installed with SilkTest | Calling DLL Passing arguments to DLL functions >>
Calling DLL Passing arguments to DLL functions
<< Calling DLL Using DLL support files installed with SilkTest | Calling DLL Passing arguments to DLL functions >>
428
User's Guide
24 C
ALLING
W
INDOWS
DLL
S
F
ROM
4T
EST
S
CRIPTS
Passing arguments to DLL functions
Passing arguments to DLL functions
This section discusses:
The valid data types for arguments passed to DLL functions
How to pass string arguments
How to pass arguments to functions that expect pointers
How to pass arguments that can be modified by the DLL function
How to pass window handles to a DLL function
Data types of
arguments
Since DLL functions are written in C, the arguments you pass to these
functions must have the appropriate C data types. In addition to the standard
4Test data types, SilkTest also supports these ten C data types:
char, int, short, and long
unsigned char, unsigned int, unsigned short, and unsigned long
float and double
Any argument you pass must have one of these data types (or be a record that
contains fields of these types).
Strings
The char* data type in C is represented by the 4Test
STRING
data type. The
default string size is 256 bytes.
The following code fragments show how a char array declared in a C struct is
declared as a
STRING
variable in a 4Test record:
// C declaration
typedef struct
{
...
char szName[32];
...
}
mswutil.inc
Contains the following utility functions:
PrintMemManInfo
PrintTaskList
PrintWindowDetail
GetStyleBitList
PrintStyleBits
Include file
Description