Displaying a Dialog With ActiveX Controls On It From a DLL Called by TestStand
Downloads
Filename: activexctrldlg.zip
Requirements: View
This example illustrates how to create a DLL in LabWindows/CVI that displays a modal dialog with ActiveX controls on it in a way that it will be compatible with calling it from a TestStand sequence.
Dialogs that contain ActiveX controls need to be treated with special consideration (as compared to dialogs without ActiveX controls) when being displayed by DLLs that are to be called by TestStand. The reason for this is that all TestStand generated threads are CoInitialized as multithreaded in the underlying COM system. Usually, threads that load and display ActiveX controls inside of containers need to be CoInitialized as single apartment threaded in order for the controls to work properly. To accomplish this in a code module to be used by TestStand, you can create a wrapper test function to be called directly by TestStand that internally just spawns a new thread containing a function that contains all of the functionality for displaying the dialog with ActiveX controls on it.
*NOTE: This information only applies to versions of TestStand prior to 3.0. Version 3.0 has a new capability of creating threads for new sequence executions that are CoInitialized as Single-Threaded Apartment directly from TestStand. Refer to the KnowledgeBase document involving this new setting in 3.0 in the Related Links section.
To use the example, just extract the .zip file to a location of your choice and load the .seq file in the TestStand Sequence Editor. Run the MainSequence by selecting the Execute >> Run MainSequence menu option.
For a more thorough explanation of this issue, visit the following links:
Requirements
Filename: activexctrldlg.zip
Software Requirements
Application Software: LabWindows/CVI Full Development System 6.0, NI TestStand Development System 2.0
Language(s): C
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
