Common DLL Problems

Here are some issues that could come up if you are calling DLL functions in a script.

Difficulty creating DLLs to use with Silk Test

Only specific data types are compatible with 4Test. These data types are listed in C data types for DLL functions.

If your DLL calls have data types not supported by 4Test, then the functions must be wrapped such that only compatible data types are used for the return type and arguments of the function. Any data types can be used inside the DLL function.

Error after compile: dll not found

In the DLL declaration, use the fully qualified path of the DLL, not just the file name.

Error executing 'CallDllFunction'

When the communication timeout between the Open Agent and the application under test is too small, the CallDllFunction might generate the error message Error executing 'CallDllFunction'. Communication timeout between agent and application.

To solve this issue, increase the timeout.
  1. Stop the Open Agent.
  2. Open the file %OPEN_AGENT_HOME%/agent/openAgent.ini.
  3. Append the following code to the file:
    -DDefaultCommTimeout=300000
    This code sets the timeout to 300000 milliseconds, which means 5 minutes. To specify no timeout, set the value to -1.
  4. Restart the Open Agent.

Error in results file: dll could not be loaded

Make sure the directory containing the DLL is on the path.

Error in results file: dll not found

This usually means that your path does not include the directory containing the DLL. If you are running remotely, make sure that the path on the machine running the agent includes the DLL directory.

Error in results file: function <name> not found in dll

The most likely scenario is that the DLL is a C++ library and the function name has been mangled. To use functions in a C++ library, you need to wrap the functions with the C wrapper and recompile. Then Silk Test Classic can access the function in the library.

If this is not the problem, there might be a typo in the function name in the DLL.

Warning in results file: String buffer size was increased from x to 256 characters

If the user calls a DLL function with an output string buffer that is less then the minimum size of 256 characters, the original string buffer is resized to 256 characters and a warning is printed. This warning, String buffer size was increased from x to 256 characters (where x is the length of the given string plus one) alerts the user to a potential problem where the buffer used might be shorter than necessary.