Copyright: TSTCON32.HLP, Version 0.04.0000


Contents for Test Container Help

Test Container provides an OLE control container in which you can test your control. Once the control has been successfully built, test its performance and functionality by changing its properties, invoking its methods, and firing its events. Test Container can display logs of events and data-binding notifications. It also provides facilities for testing an OLE control’s persistence functionality: you can save properties to a stream or to substorage, reload them, and examine the stored stream data.

How to . . .

Insert a control in Test Container’s document

Change the control’s property values

Invoke the control’s Properties verb

Log the control’s events

Call the control’s methods

Change Test Container’s ambient properties

Display a log of data-binding notifications

Save, view, and load property values

Test Container Commands

Toolbar Buttons

File Menu Commands

Edit Menu Commands

View Menu Commands

Options Menu Commands

Help Menu Commands


Inserting an OLE Control

Before testing your control, you must build and register it. See the articles OLE Controls and OLE ControlWizard in Programming with MFC and Chapter 20, Creating the Circle Control in Tutorials.

To insert an OLE control into Test Container:

1	From Test Container’s Edit menu, choose the Insert OLE Control command.

Toolbar:

The Insert OLE Control dialog box appears.

Your control appears in the list box as “Prjname Control,” where Prjname is the name of your project.

2	Select the desired control.

3	Choose OK.

The control is inserted into Test Container.

Note   If your control is not listed in the Insert OLE Control dialog box, make sure you have registered it with the Register Control command from the Tools menu of Visual C++.


Changing Property Values

Test Container provides quick access to your control’s property values. Besides accessing the values directly, you can call your control’s Properties verb.

To change property values:

1	From the View menu, choose Properties.

Toolbar:

The Properties dialog box appears.

2	Type the name of a control property in Property box, or choose the name from the drop-down list box.

The current value of the property appears in the Value list box.

3	Type a new value for the property.

4	Click the Apply button.

The property now contains the new value.

Use the Invoke Properties Verb and Multiple Selection Props buttons to invoke the properties verb for one or more selected controls. See Invoking the Properties Verb


Invoking the Properties Verb

Test Container makes it easy to invoke your control’s Properties verb (OLEIVERB_PROPERTIES). When this verb is invoked, the control opens a modal property dialog box that contains the control's property pages.

You can invoke the Properties verb for a single selected control or for multiple selected controls.

To invoke the Properties verb:

1	Select one or more controls. (To select multiple controls, click one control, then press SHIFT as you click other controls.)

2	Choose the Properties toolbar button

The Properties dialog box appears.

3	Choose Invoke Properties Verb to invoke the Properties verb for the most recently selected control.

– Or –

Choose Multiple Selection Props to invoke the Properties verb for all selected controls.

A property-page dialog box appears. Depending on which option you have chosen, this will be either the Prjname Control Properties dialog box or the Multiple Selection Properties dialog box.

4	Change the properties as necessary.

5	Choose Apply Now to apply the new property values.

6	Choose OK to close the dialog box.


Logging Events

To log events

1	Choose Event Log from the View menu.

Toolbar:

The Event Log window appears.

2	Perform an action that causes the control to fire an event.

The event appears in the Event Log window.

Event Log Window

eventlog.mrb


Calling Methods

To call the control’s methods

1	From the Edit menu, select Invoke Methods.

Toolbar:

The Invoke Control Method dialog box appears.

2	Select the method’s name from the Name listbox.

– Or –

Select the method’s ID from the ID listbox.

3	If the method has parameters, edit controls for those parameters appear in the middle part of the dialog box. Enter appropriate values.

4	Click Invoke.

The method is invoked with the parameters specified (if any).


Changing Ambient Properties

Ambient properties are named characteristics of the container that apply to all controls in the container unless otherwise specified. Examples of ambient properties are default colors and fonts. Ambient properties can also be modes: for example, a container’s ambient property can specify whether the container is in “design mode” or “run mode.”

To change ambient properties

1	From the Edit menu, choose Set Ambient Properties

Toolbar:

The Ambient Properties dialog box appears.

2	Choose a standard property or a non-standard property from the list boxes.

3	Enter appropriate values in the middle panel of the dialog box.

4	Choose Close.

To add a non-standard property

1	From the Edit menu, choose Set Ambient Properties

Toolbar:

The Ambient Properties dialog box appears.

2	Type the name of the non-standard property in the Non-Standard Property box.

3	Choose the property’s type from the Type box.

4	Choose the property’s value in the Value box.

5	Choose Add.

6	Choose Close.

To delete a non-standard property

1	From the Edit menu, choose Set Ambient Properties

Toolbar:

The Ambient Properties dialog box appears.

2	Choose the property’s name from the Non-Standard Property box.

3	Choose Delete.

4	Choose Close.


Displaying Data-Binding Notifications

Test Container allows you to display a log of data-binding notifications. In addition, you can control Test Container’s response to OnRequestEdit notifications.

To display data-binding notifications

1	From the View menu, choose Notification Log.

Toolbar:

The Notification Log dialog appears.

2	Choose a button in the OnRequestEdit() Response to determine Test Container’s response to that notification.

3	Choose Clear to clear the notifications log.


Saving, Viewing, and Loading Property Values

Test Container can save a control’s property values either to a stream or to substorage. When you have saved property values, you can create a new control and initialize its property values with those you have stored. You can also view the contents of the saved control stream.

To save property values to a stream

1	Select the control whose property values you want to save.

If you select multiple controls, only the first you selected will be saved.

2	From the File menu, choose Save to Stream.

To view property values saved to a stream

•	From the View menu, choose Saved Control Stream

The Saved Control Stream dialog box appears. Use the list box at the top to select a particular control’s values in the stream display, or use the stream display’s scroll bars to display the part of the stream you want to see. Choose the Refresh button to update the display in this modeless dialog box.

To save property values to substorage

1	Select the control whose property values you want to save.

If you select multiple controls, only the first you selected will be saved.

2	From the File menu, choose Save to Substorage.

To load property values from substorage or a stream

•	From the File menu, choose Load.

A new control is created, and its property values are initialized with those of the next previously saved control.


Toolbar Buttons

The Test Container’s toolbar has six buttons for performing frequent operations:

Button	Effect
	Inserts a new control.
	Displays ambient properties for viewing or changing.
	Shows or hides property values for the selected control.
	Shows or hides the display of events fired by the control.
	Permits calling of the control’s methods.
	Shows or hides display of data-binding notifications.
In addition, a button representing an OLE control is added to Test Container’s toolbar when you insert a control of that type in Test Container’s document window. For example, this button

appears when you insert a Circle control from the CIRC3 sample project.


File Menu Commands

The File menu provides commands for loading and saving properties, registering OLE controls, and exiting Test Container.

Save to Stream

Saves the selected control to a new or existing stream.

Save to Substorage

Saves the selected control to a new substorage.

Load

Loads the next previously saved control.

Save Property Set

Saves the selected control’s property set to a docfile.

Load Property Set

Creates a new control and initializes it with properties from a docfile.

Register Controls...

Registers or unregisters controls.

Exit

Exits Test Container.


Edit Menu Commands

The Edit menu provides commands for inserting and deleting OLE controls, viewing and changing their properties, invoking their methods, and performing various other operations on controls.

Insert OLE Control...

Inserts a new OLE control.

Delete

Deletes the selected OLE control.

Delete All

Deletes all OLE controls.

Set Ambient Properties...

Enables you to view or change container properties that affect all controls.

View Event List...

Enables you to choose whether a control’s events are logged and to specify which of its events are logged.

Invoke Methods...

Enables you to invoke a control’s methods.

Draw Metafile

Causes a control to be redrawn from its metafile.

Embedded Object Functions

Displays a submenu from which you choose functions of the embedded OLE control:

•	Primary Verb

Invokes the control’s primary verb.

•	Activate

Activates the control and puts it in the Loaded state.

•	UI Activate

Puts the control in the UI Active state.

•	Close

Closes the control and puts it in the Loaded state.

•	Deactivate

Deactivates the control and puts is in the Loaded state.

•	Deactivate UI Only

Restores Test Container’s user interface to its original state.

•	Hide

Hides the control and puts it in the Loaded state.

•	Open

Opens the control in “stand-alone” mode and puts it in the Open state.

•	Reactivate and Undo

Reactivates a control and puts it in the Loaded state.

•	Run

Runs the control and puts it in the Loaded state.

•	Show

Activates the control and puts it in the UI Active state.

•	Properties

Invokes the control’s Properties verb.

In addition, some controls cause the item Object to be modified to Properties...Prjname Control Object (where Prjname is the name of the control project) to the end of the Edit menu.

•	Properties...Prjname Control Object

Invokes the control’s Properties verb.


View Menu Commands

Commands on the View menu allow you to view and hide Test Container’s toolbar and status bar, as well as its event and notification logs and its Properties dialog box.

Toolbar

Toggles display of Test Container’s toolbar.

Status Bar

Toggles display of Test Container’s status bar.

Event Log...

Toggles display of the Event Log, which displays events fired by the control.

Notification Log...

Toggles display of the Notification Log, which displays notifications that are sent when the control’s properties are changed.

Saved Control Stream

Toggles display of the Saved Control Stream dialog box, which shows the stream containing saved control properties. See Saving, Viewing, and Loading Property Values.

Properties...

Toggles display of the Properties dialog box, which you can use to change the control’s properties directly or to invoke the control’s Properties verb.


Options Menu Commands

The Options menu provides commands for controlling Test Container’s interaction with embedded OLE controls.

Passive Container Mode

Test Container does not automatically change control states.

Simulated Design Mode

Test Container manages control states to simulate forms design mode.

Freeze Events

Used to inform the control that the container is ignoring events. This gives the control the opportunity to modify its behavior, if desired.

Honor ACTIVATEWHENINVISIBLE

Toggles Test Container’s support for the OLEMISC_ACTIVATEWHENINVISIBLE flag.


Help Menu Commands

The command on the Help menu displays information about Test Container.

Contents

Displays the Contents page for Test Container help.

About Test Container...

Displays Test Container’s About dialog box.