Calling DLLs from TestStand
- Updated2024-11-26
- 1 minute(s) read
Calling DLLs from TestStand
You can call LabVIEW, Microsoft Foundation Class (MFC), and subordinate DLLs from TestStand. If a DLL contains export information, TestStand displays parameter information on the Module tab on the Step Settings pane.
Calling LabVIEW DLLs that Use ActiveX Controls
LabVIEW shared libraries (DLLs) that use ActiveX controls must load in a thread initialized as single-threaded apartment (STA) for the controls to function correctly. When the TestStand step that calls the DLL preloads the DLL, TestStand ensures that the DLL loads in an STA thread. However, when you dynamically load a step that calls the DLL, you must ensure that the loading sequence executes in an STA thread.
Use the Run Sequence in a New Thread option or the Run Sequence in a New Execution option located in the Multithreading and Remote Execution section in the Edit Sequence Call dialog box to select an STA thread. Click the Settings button in the Edit Sequence Call dialog box to launch the Thread Settings dialog box, which contains the STA thread options.
Calling DLLs that Use MFC Functions
The MFC Library places several requirements on DLLs that use the DLL version of the MFC run-time library. When you call a DLL that includes MFC functions, verify that the DLL meets these requirements. Also, when the DLL uses resources such as dialog boxes, verify that the AFX_MANAGE_STATE macro appears at the beginning of the function body of each function you call. Refer to the MFC documentation for more information about calling DLLs.