C/C++ DLL Call Parameters

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Structure Parameters

You can pass variables and properties you create with named data types to function parameters that accept structures. When you create or edit a data type, you specify whether the type can be a structure argument and how the type represents itself in memory when you pass it to a structure parameter.

If you build a LabWindows/CVI module DLL with the Add NI Type Information resource to DLL option enabled, you can use the Create/Update Custom Data Type button on the LabWindows/CVI Module Tab to access the Create/Update Custom Data Type from Struct Dialog to create the TestStand container type.

Notes Notes
  • You can pass NULL to a structure pointer parameter by passing an empty object reference or the constant Nothing. Do not pass the constant 0.
  • The C/C++ DLL Adapter cannot call functions that specify structure parameters that contain pointers to memory which the function allocates or deallocates.

Type, and Pass by Value or by Reference

When you select the C Struct category for a parameter, the C/C++ DLL Adapter displays the Type and Pass controls. The Type control specifies the TestStand named data type the adapter uses to determine how to pack the structure elements in memory. The Pass control specifies whether TestStand passes the value of the argument you specify in the Value Expression control or passes a pointer to the argument. If you select By Pointer (*) or By Reference (&), the adapter passes a pointer to the argument value. If you choose to pass a pointer, the argument you specify in the Value Expression control must be the name of a variable or property.

See Also

Mapping Parameters

Passing a Struct to a C DLL (Example)


Not Helpful