DLL Object

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

The DLL object contains methods and properties that allow scripts to call routines from dynamic link libraries. Before calling a routine, the script should perform a number of operations: Define an environment for loading DLLs with certain “bitness” (this is important if you use both 32-bit and 64-bit libraries in your script), define the DLL type and define types of functions in this DLL, load the required DLL in memory, prepare function parameters, etc. For a detailed explanation of these operations, see Calling DLL Functions From Tests - Tutorial. There are two limitations on the functions that can be called:

  • The DLL object supports only the routines that match the stdcall calling convention. (This calling convention is used by Windows API functions). Normally, converting a routine to the stdcall convention is not difficult. You should add stdcall to the function declaration. For more information, read documentation on the compiler you use.

  • If a function returns a pointer, the data that it points to is inaccessible to scripts. For example, if a routine allocates a structure and returns a pointer to it, the data in this structure will not be accessible to scripts. To solve such a problem, you can modify the routine so that it returns a structure using an "out" parameter, and then you can create the desired structure in your script and pass it to the routine as a parameter.

The DLL object is available only if the DLLAccess plugin is installed.

Members

Example

To view an example that demonstrates how to use the DLL object, see Calling DLL Functions From Tests - Tutorial.

See Also

Calling DLL Functions From Tests
Calling DLL Functions From Tests - Tutorial
TestComplete Helper Objects

Highlight search results