TSTCON: ActiveX Control Test Container

Click to open or copy the TSTCON project files.

The TSTCON sample implements an ActiveX control container using MFC's support for OLE embedding. You can use TSTCON to test ActiveX controls, change their properties, and invoke their methods. You can write scripts using the VBScript language to automate the testing of the controls. TSTCON can keep a log of the events and property change notifications fired by a control.

TSTCON also demonstrates several MFC programming topics, including the following.

Running the Sample

To launch a control in the container

  1. From the Tools menu, click ActiveX Control Test Container.

  2. In Test Container, from the Edit menu, click Insert New Control.

  3. From the list box, select Calendar Control 8.0, and click OK. The Microsoft Calendar Control appears in the upper half of the splitter window.

  4. Manipulate the calendar by changing month, year, and date. In the lower pane, observe how the logs, events, and property change notifications are fired by the control as you manipulate it.

To change the control's properties

  1. Select the calendar control by clicking the calendar's border.

  2. From the Edit menu, click Properties. Test Container displays the Properties dialog box for the control.

  3. Using this dialog box, you can edit the properties of the control. Change the control's properties and observe the changes.

  4. Close the Properties dialog box.

To invoke methods on the control

  1. From the Control menu, click Invoke Methods. The Invoke Method dialog box appears.

  2. In the Method Name combo box, select BackColor (PropPut).

  3. From the Parameter Type combo box, select VT_COLOR.

  4. Click Choose Color, choose a color from the color palette, and click OK

  5. In the Invoke Method dialog box, click Invoke. The background color of the calendar control changes to the color you selected in the color palette.

For more information on how to use the Test Container, from the Help menu, click Help Topics.