Tip If you prefer working from a printed tutorial, see Copying and Printing in MSDN Library Help for details about printing a lesson, a set of topics, or a single topic.
The ability to define a custom set of properties, events, and methods for a control is one of the most powerful features of control writing. The previous lesson illustrated the use of a stock property. This lesson illustrates how to add a custom property to the Circle control.
Note You can find a finished example of this lesson's code in the CIRC2 sample source code directory.
Properties are typically used to represent control data or attributes. For example, a Date control might define a DateValue property, which provides access to the current date value displayed in the control. This type of property represents control data. In addition, the Date control may define a Format property, which allows the user to get and set the display format of the date. This type of property represents a control attribute.
ActiveX control classes support four types of custom properties:
Implemented using a member variable.
Implemented using a member variable and a notification function.
Implemented using Get/Set functions.
Implemented using Get/Set functions and an index parameter.
In the following topics, you will add the CircleShape property, which is an example of a DISP_PROPERTY_NOTIFY custom property. CircleShape is a Boolean property that displays the control as a perfect circle, if set to TRUE; or as an ellipse, if set to FALSE. (The DISP_PROPERTY_EX and DISP_PROPERTY custom property types are used later in the tutorial.)
In this lesson, you will: