Testing the Control CircleShape Property

You have implemented the CircleShape property's functionality. You can now use Test Container to test the code.

To insert the Circ control in Test Container

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

  2. On the Edit menu, click Insert New Control.

    The Insert Control dialog box appears.

  3. From the list box, select Circ Control.

  4. Click OK to close the Insert Control dialog box and insert the control into Test Container.

    The Circle control is displayed in Test Container. Notice that the control is initially drawn as a perfect circle because the CircleShape property is set to TRUE in the DoPropExchange member function in the CCircCtrl class.

Next, change the value of the CircleShape property to cause the Circle control to be redrawn as an ellipse.

To change the CircleShape property

  1. On the Control menu, click Invoke Methods.

  2. From the Method Name drop-down combo box, select the PropPut version of CircleShape. The Value column of the Parameters control displays a default of 0.

    Note   If the CircleShape property is not listed, the control might not be selected or the type library may not have been regenerated before the control was last built.

  3. Click Invoke.

    Invoking the PropPut method changes the value of the CircleShape property to the value reflected in the Parameter Value edit box — in this case, 0. It does not necessarily reflect the current value of the property. To check the current value of the CircleShape property, invoke the PropGet method and check its return value.

The Circle control is redrawn as an ellipse the size of the control's bounding rectangle. It is immediately redrawn, because changing the CircleShape property causes the OnCircleShapeChanged notification function to be called, which invalidates the control.

When you have finished, close Test Container.