DLL functions are written in C, so the arguments that you pass to these functions must have the appropriate C data types.
The following data types are supported:
- int
- Use this data type for arguments or return values with the following data types:
- int
- INT
- long
- LONG
- DWORD
- BOOL
- WPARAM
- HWND
The
Java type
int works for all DLL arguments that have a 4-byte value.
- long
- Use this data type for arguments or return values with the C data types long and int64. The
Java type
long works for all DLL arguments that have an 8-byte value.
- short
- Use this data type for arguments or return values with the C data types short and WORD. The
Java type
short works for all DLL arguments that have a 2-byte value.
- boolean
- Use this data type for arguments or return values with the C data type bool.
- String
- Use this for arguments or return values that are Strings in C.
-
double
- Use this for arguments or return values with the C data type double.
- com.borland.silktest.jtf.Rect
- Use this for arguments with the C data type RECT.
Rect cannot be used as a return value.
- com.borland.silktest.jtf.Point
- Use this for arguments with the C data type POINT. Point cannot be used as a return value.
- com.borland.silktest.jtf.TestObject
- Use this for arguments with the C data type HWND. TestObject cannot be used as a return value, however you can declare DLL
functions that return a HWND with an Integer as the return type.
Note: The passed TestObject must implement the
com.borland.silktest.jtf.INativeWindow interface so that
Silk4J is able to determine the window handle for the TestObject that should be passed into the DLL function. Otherwise an exception
is thrown when calling the DLL function.
- List
- Use this for arrays for user defined C structs. Lists cannot be used as a return value.
Note: When you use a List as an
in/out parameter,
the list that is passed in must be large enough to hold the returned contents.
Note: A C struct can be represented by a List, where every list element corresponds to a struct member. The first struct member
is represented by the first element in the list, the second struct members is represented by the second element in the list,
and so on.
Note: Any argument that you pass to a DLL function must have one of the preceding
Java data types.