Overview | How Do I ... Topics
When defining a property for an MFC dispinterface, you can implement the property with a member variable or with Get/Set methods. Using the member variable implementation provides direct access to the property, whereas using Get and Set methods to implement the property enforces a controlled access. If you do implement the property via a member variable, you can also provide a notification function to alert you when the value of the property changes.
To add a property to an MFC dispinterface
This is the name automation clients will use to access the property.
Your choice is reflected in the two text boxes below the Type list. By default, Member variable is selected, displaying the Variable name and Notification function boxes. Choosing Get/Set methods displays the Get function and Set function boxes.
The Stock implementation choice is available only for ActiveX controls.
The Parameter list is unavailable for a member variable implementation.
The property in its Get/Set or member variable implementation is visible in ClassView under the interface where it is defined, and under the class where it is implemented. Double-click an icon under the interface to jump to the .idl or .odl file. Double-click an icon under the class to jump to the .cpp file.