TestStand 2019 Help
»View Product Info
Insert a step configured to use the ActiveX/COM Adapter and select Specify Module from the context menu to launch the Edit ActiveX/COM Call dialog box from a TestStand User Interface. You can also select Properties from the context menu and then click Specify Module in the Step Properties dialog box to launch the Edit ActiveX/COM Call dialog box.
The Edit ActiveX/COM Call dialog box contains the following options:
- Object Reference—An Object Reference variable or property. When a step creates an object, the ActiveX/COM Adapter assigns the object reference to the variable or property, if specified. Otherwise, the ActiveX/COM Adapter automatically releases the object reference after executing the step. If the step does not create an object, but instead calls a method or accesses a property, the Object Reference control must contain the value of a valid ActiveX reference that refers to the object on which to call the method or access the property. Click the Expression Browse button to launch the Expression Browser dialog box.
- Automation Server—The name of the server the step uses. The ActiveX/COM Adapter populates the ring control with the list of ActiveX Automation servers registered with Microsoft Windows. To select a server from the list, click the ring control or Browse to load a type library file from disk for a specific server. If you want the ActiveX/COM Adapter to refresh the list of registered servers and type library information, click Reload. You can also refresh the server type library information when you select File»Unload All Modules. If the server has a help file associated with it, you can open it by clicking the ? button.
||Note TestStand registers the type library with Windows when you click the ? button.
- Object Class—The name of the server class the step uses when it creates or invokes an object of the class. When you select a server, the ActiveX/COM Adapter populates this control with a list of objects defined for the server. The ring control separates the list of objects into two groups which are separated with a line. The upper group includes all top-level objects the ActiveX/COM Adapter can create. The lower group includes all other objects the server creates as a result of an invocation of a method or get property call. If a server type library contains help strings or links to a help file for a class, click the ? button to access the help.
- Create Object—When you enable this option, the step creates a new instance of the object class when the ActiveX/COM Adapter executes the step. When the step creates an object and you specify a property name in the Object Reference control, the ActiveX/COM Adapter assigns the value of the object handle to the property. Otherwise, the ActiveX/COM Adapter automatically releases the object reference after it executes the step.
When you create an object, you can select one of the following options:
||Note Do not select Create Object when specifying an existing ActiveX object such as RunState.Engine or RunState.Sequence in the Object Reference control.
- Create New—Creates a new object and obtains a reference to the object. If the server application is already running, this option might launch another copy of the application. The server application decides when to launch a new instance of the application.
- Attach to Active—Obtains a reference to an active Application object. TestStand can obtain an active reference when the ActiveX server registers the object in the Running Object Table (ROT) for the operating system. Typically ActiveX servers register objects as weak references, so when the last reference to the object is released, TestStand might be unable to attach to the active reference. To work around this limitation, ActiveX servers can create a strong reference in the ROT by locking the object. For example, LabWindows/CVI ActiveX servers can use the CA_ServerLockActiveObject and CA_ServerUnlockActiveObject functions to lock and unlock the object in the ROT.
- Create From File—Loads an existing object from a file and obtains a reference to the object. If the server application is already running, this option might launch another copy of the application. The server application decides when to launch a new instance of the application. When you enable this option, the Edit ActiveX/COM Call dialog box displays a File Selection control and a Browse button. You can use these controls to specify the path of the file.
- Remote Host (optional)—The remote system where the object is created. This control dims when you select Attach to Active.
- Specify Expression for Host—Specifies whether the Remote Host control contains an expression the ActiveX/COM Adapter evaluates at run time to determine the name of the remote host.
- Use Step Load/Unload Options to Specify Object Creation Time and Lifetime—Controls the lifetime of an object the step creates. When you do not set this option, the step creates the object when the step begins and then releases the internal reference of the step to the object when the step completes. When you enable this option, the step creates the object when the step loads according to the Load option for the step and then holds an internal reference to the object until the step unloads according to the Unload option for the step. This option is dimmed when you enable the Specify Host By Expression control.
- Call Method or Access Property—Specifies if the step invokes a class method or accesses a class property when the ActiveX/COM Adapter executes the step. This control lists the types of access the server defines for the selected object class, including Call Method, Get Property, Set Property, and Set Property by Reference. If an object class does not have any methods, the control does not list the Call Method option.
After you select the type of access, the ActiveX/COM Adapter populates the Method control with the method or property names the class defines for the access type. If a server type library contains help strings or links to a help file for a method or property, click the ? button to access the help.
- Parameters Table—Contains the input and output parameters for the selected method or property. If the selected access type is Get Property, the control usually contains a single output parameter. If the access type is Set Property or Set Property by Reference, the control usually contains a single input parameter. When you call a method, the control can contain any number of input and output parameters. The ActiveX/COM Adapter automatically populates the Value field for parameters that have default values.
- Name—A symbolic name for the parameter.
||Note Parameters with attributes include an Edit Attributes button in the Name column of the Parameters Table. TestStand associates parameter attributes with the module parameter, which TestStand stores with the step configuration information, not with the parameter value that TestStand passes to the module. Right-click an item in the Parameters Table to access the Parameters Table context menu, from which you can launch the Attributes dialog box.
- Type—ActiveX data type for the parameter.
- Direction—Specifies whether the parameter is an input or an output.
- Log—When you enable this option, the step logs the parameter as an additional result. Enabling this option is equivalent to using the checkbox next to the additional result name in the Additional Results dialog box. For in/out parameters, enabling this option enables the [In] parameter and the [Out] parameter in the Additional Results dialog box. This option is indeterminate for in/out parameters if you specify to log only the [In] parameter value or only the [Out] parameter value. If this option is indeterminate, a tooltip specifies whether the Additional Results dialog box specifies to log the [In] parameter value or the [Out] parameter value.
- Default—When you enable this option, TestStand uses the default value for the parameter.
- Value—A TestStand expression. For input parameters, TestStand passes the value of this expression. For output parameters, TestStand stores the data the method returns in the location this expression specifies. To help you enter an expression in the Value column, click the Expression Browse button to launch the Expression Browser dialog box. For enumerated types, a combo box displays all valid values for the type. You can use an expression with an enumerated type. Refer to the ActiveX/COM Call Parameters topic for more information about using enumeration parameters.
||Note A known issue exists with using in-process (DLL) ActiveX servers created with Microsoft Visual Basic from a multithreaded client application such as TestStand. This issue can cause these types of servers to fail with an access violation. Under certain circumstances, this failure can cause TestStand to crash or hang when freeing resources in the DLL.
Refer to the Microsoft support article Q186273 at support.microsoft.com/kb/186273 for more information about this issue.
Out-of-process (EXE) servers do not have this problem.
ActiveX/COM Code Module Support for 64-bit TestStand
Additional Results dialog box
Attributes dialog box
Expression Browser dialog box
In-Process COM Servers Support in 32-bit TestStand and 64-bit TestStand
Out-of-Process COM Servers in 32-bit TestStand and 64-bit TestStand
Parameters Table Context Menu for Specify Module Dialog Boxes
Step Properties dialog box
Using the $(Platform) Path Macro to Locate the Correct Code Module in 32-bit TestStand and 64-bit TestStand