Defining the Note Property

Initially, the Note property is a typical custom Get/Set property of type BSTR. After the Note property is added to the Circle control, the GetNote and SetNote functions are completed, the property is made persistent, and a control to edit its value is added to the property page.

To add the Note Get/Set property

  1. On the View menu, click ClassWizard.

  2. Click the Automation tab.

  3. In the Class name drop-down list box, select CCircCtrl.

  4. Click Add Property.

    The Add Property dialog box appears.

  5. In the edit control of the External name drop-down combo box, type Note.

  6. Under Implementation, select Get/Set methods.

  7. From the Type list box, select BSTR.

  8. Click OK to close the Add Property dialog box.

    This returns you to the Automation tab. Notice that the implementation of the Note property appears as:

    Implementation:
    BSTR GetNote();
    void SetNote(LPCTSTR lpszNewValue);
    
  9. Click OK to confirm your choices and close ClassWizard.

ClassWizard adds the Note property to the Circle control. As you've seen in earlier lessons, ClassWizard modifies CIRC.ODL, CIRCCTL.CPP, and CIRCCTL.H to define the Note property.