Article ID: 146446 - Last Review: December 9, 2003 - Revision: 3.0 PRB: ClassWizard Doesn't Support Property Change NotificationsThis article was previously published under Q146446 SYMPTOMS
ClassWizard makes adding event handlers in an OLE control container much
easier by providing the required macros, function declarations, and the
function body. However, ClassWizard currently doesn't provide support to
add handlers for property change requests and property change
notifications. You must manually add the macros, function declarations, and
the function body required for defining an event sink map entry in order to
handle property change notifications. This article explains the steps
necessary for handling one such property change notification.
RESOLUTION
The following steps illustrate how to handle property change notifications
for the "Caption" stock property of the Circ3 sample control in a dialog
based control container application:
MORE INFORMATION
An OLE control container would typically implement IPropertyNotifySink in
order to receive notifications about property changes from an OLE control.
The control container creates a sink with this interface and connects it to
the control through the connection point mechanism.
The OLE control itself is required to call the methods of IPropertyNotifySink only for those properties marked with the [bindable] and [requestedit] attributes in the object's type information. When the control is about to change a [requestedit] property, it must call IPropertyNotifySink::OnRequestEdit before changing the property and must also honor the action by the sink on return from this call. Also, when the control changes a [bindable] property, it is required to call IPropertyNotifySink::OnChanged. An OLE control will send these notifications only for property changes occurring after it is fully constructed and initialized. REFERENCES
Online documentation for ON_PROPNOTIFY and ON_PROPNOTIFY_RANGE.
Online documentation for Property Change Notification.
APPLIES TO
| Article Translations
|
Back to the top
