Re: Apply changes in a property dialog
"Marcel Beutner" <email@example.com> wrote in message
When I add my ocx into a vb 6.0 or msaccess project and open the
propertybag dialog, the apply button has no effect. Ok "no effect"
isn't absolutly correct, but I can't see any changes in the "IDE
Implement a connection point for IPropertyNotifySink, fire OnChanged
event every time the property changes (for any reason - from property
sheet or otherwise). Mark all properties that you provide these
notifications for with [bindable] attribute in the IDL.
To implement IPropertyNotifySink in ATL, derive from
IPropertyNotifySinkCP and add an entry to connection point map. If your
object derives from CComControl, you have handy FireOnChanged method,
otherwise call CFirePropNotifyEvent::FireOnChanged.
By the way, if your control is wizard-generated, chances are it is
already set up with IPropertyNotifySinkCP and everything else necessary.
Then you just need to add FireOnChanged calls in your property setters,
and put [bindable] attribute in IDL.
With best wishes,
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925