DLL.Load method loads a particular dynamic link library in TestComplete and returns a pointer to the library. Later, this pointer can be used to call routines from the dll. Before you load a dll, you should define its type and type of its functions using the
DLL.DefineDLL method and methods of the
DLL.Load "binds" these definitions with the actual library code. If the specified dll is not found,
DLL.Load displays an error message.
|If you call
DLL.Load twice or more times with the same input parameters, the method will load the dynamic link library only after the first call and will return pointers to the loaded library after subsequent calls. Thus, you can obtain a pointer to the loaded dynamic link library at any time later by calling
DLL.Load once again with the same input parameters.
|Default value: Empty string
|Pointer to the library
The method is applied to the following object:
The method has the following parameters:
The file name, extension and absolute or relative path to the dynamic link library. If the file extension is omitted,
Load uses .dll. If the path is not specified, the method searches for the dll in the following order:
- The folder, in which TestComplete is installed.
- The current working folder of the TestComplete process.
- The <Windows>\System32 (or the <Windows>\System) folder.
- The <Windows> folder.
- The folders specified in the PATH variable.
|The WOW64 subsystem may redirect calls to some system libraries when you work with 32-bit applications. To load a library of a particular bitness, specify the full path to the required library.
The name of the dll type defined by the
DLL.DefineDLL method. If it is omitted, TestComplete uses the dll file name as the dll type name (the file extension is excluded). For example, if you call the following code, TestComplete will use User32 as the dll type name.
Lib = DLL.Load("C:\\Windows\\System32\\User32.DLL")
A pointer to the specified dynamic link library.