Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How can SilkTest call a DLL from 4Test?

How can SilkTest call a DLL from 4Test?

Assume that there is a DLL named mynew.dll containing a function named MyFuncA that you wish to call from 4Test as a function named MyFunc.

The function takes a window handle and a string as arguments and returns a Boolean value.
This shows how to declare it in 4Test:

  1. Declare the DLL:

    dll "mynew.dll"

    BOOL MyFunc (HWND hWnd, LPSTR sText) alias "MyFuncA"

  2. Use the function as you would with any other 4Test function:

    main ()

    Print (MyFunc (Desktop.hWnd, "My string"))

Writing DLL"s:

DLLs can also be used to add functionality that 4Test does not provide.

In the PageList class there is no way for SilkTest to determine how many rows there are in a PageList object or the RECT of an individual tab. However, there are functions available to do this in the Windows API.

Since the functions in the API use data types that 4Test does not support, you would need to create a DLL to make these calls and then return the required information back to 4Test in a data type that it can handle.

Attached below is the C++ source file required to implement this.


pagelist.cpp

Related documents:

Old KB# 22039

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:27
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.