"User Types Not Recognized" Error Using TestStand C/C++ DLL Adapter

Updated Dec 4, 2025

Reported In

Software

  • TestStand

Issue Details

When using the C/C++ DLL Adapter in TestStand to call a DLL created in Visual Studio (or another compiler), you may encounter the following error:

This function either does not have parameter information in the DLL or uses types not recognized by TestStand.

This typically occurs because TestStand cannot interpret the function signature or parameter types exposed by the DLL. Common causes include:

  • The DLL does not export functions with proper metadata or uses C++ name mangling.
  • Functions use unsupported or complex data types (e.g., custom structs, classes, pointers without clear size information).
  • Missing extern "C" declaration for C++ functions, causing symbol mismatch.
  • Incorrect bitness (32-bit vs. 64-bit) between TestStand and the DLL.
  • Parameter types not mapped to TestStand-compatible types (numeric, string, arrays, containers).

Solution

To successfully call a DLL function from TestStand using the C/C++ DLL Adapter, follow these best practices:

  1. Ensure Proper Function Export
    • Use extern "C" for C++ functions to prevent name mangling.
    • Export functions with simple, supported parameter types (e.g., int, double, char*).
    • Avoid passing complex C++ objects directly; instead, use pointers to structs or primitive types.
  2. Match Architecture
    • Verify that the DLL matches the TestStand process architecture (32-bit or 64-bit).
    • If supporting both, maintain separate DLL builds and use platform-specific paths in TestStand (e.g., $(Platform)\MyDLL.dll).
  3. Configure the Step in TestStand
    • Insert an Action or Test step and set the adapter to C/C++ DLL.
    • In the Module tab, browse to the DLL and select the exported function.
    • Map parameters to TestStand variables. For pointers or arrays, ensure proper allocation and pass by reference.
  4. Handle Complex Data Types
    • For structs, create a TestStand container type that matches the struct layout.
    • Pass the container by reference to the DLL function.
  5. Debugging Tips
    • Use the Edit C/C++ DLL Call dialog to verify parameter mapping.
    • If the function does not appear in the list, confirm that it is exported and uses supported types.

Additional Information

TestStand includes an example demonstrating how to pass structs to DLL functions:

Location:

<TestStand Public>\Examples\Fundamentals\Passing Structs to Code Modules\C\Passing Structs to Code Modules.seq

This example demonstrates how to pass a TestStand container as a C-style struct to a function in a DLL. This example uses functions to pass the struct by both reference and value. For a DLL function to change the value of a TestStand container, you must pass the reference of the container to the function.