Support for calling routines implemented in dynamic link libraries (DLLs) from TestComplete tests has some known limitations. They are listed below in this topic:
Only standalone exported routines can be called from TestComplete tests. There is no way to call methods of exported classes.
The DLL routine to be called must match the
DLL routines that get structures containing array-type members (for instance, string or array fields) via their parameters are not currently supported by TestComplete. See Using Custom Data Structures in DLL Function Calls for more information.
Currently, TestComplete cannot obtain results from Delphi routines that return interface references (for instance,
IUnknown). For more information, see Returning Interface References From DLL Functions.
Currently, TestComplete does not support several string types for function results (for instance,
char *). These string types are supported for function parameters only. Moreover, the
stringDelphi type is supported by TestComplete neither for function parameters nor for result values. For more information, see Using String Parameters in DLL Function Calls.
Native string variables created in TestComplete scripts cannot be passed to a DLL routine via its parameters. You should always create an appropriate helper variable of the
LPWSTRdata type defined in TestComplete to pass a string value via a DLL routine’s parameters. See Using String Parameters in DLL Function Calls for more information.
Compilers can align structure members at certain bounds: at bytes, words, double words, etc. When passing structures via a DLL routine’s parameters, TestComplete does not align structure members itself. Therefore, when you define custom structure types in TestComplete with the
IDLLAccessProcess.DefineTypemethod, you should consider the alignment that was used when compiling the DLL and the actual size of structure members and specify properly the appropriate size of structure members. For more information, see Parameter Types for C++ Routines and Structures and Parameter Types for Delphi Routines and Structures.