IAdviseSink2

The IAdviseSink2 interface is an extension of IAdviseSink and was defined to prevent overloading the IAdviseSink::OnRename method. Without IAdviseSink2, embedded objects and link sources, upon being renamed, would both have to notify their containers by calling IAdviseSink::OnRename. In applications where different blocks of code might execute depending on which of these two similar events has occurred, using the same method for both events complicates testing and debugging. With IAdviseSink2, embedded objects whose name has changed still call IAdviseSink::OnRename, but the link object maps this notification to IAdviseSink2::OnLinkSrcChange. Making this distinction explicit makes it easier to test and maintain your code.

When to Implement

If your application supports links, you should definitely implement IAdviseSink2. Even if your application does not support links, it may do so in future releases. Since the IAdviseSink2 interface inherits all the methods of IAdviseSink without additional overhead, it makes sense to implement IAdviseSink2 in all cases.

When to Use

When a link source is renamed, the link object should notify its container by calling IAdviseSink::OnLinkSrcChange.

Methods in Vtable Order

IUnknown Methods
Description
QueryInterface
Returns pointers to supported interfaces.
AddRef
Increments reference count.
Release
Decrements reference count.

IAdviseSink Methods
Description
OnDataChange
Advises that data has changed.
OnViewChange
Advises that view of object has changed.
OnRename
Advises that name of object has changed.
OnSave
Advises that object has been saved to disk.
OnClose
Advises that object has been closed.

IAdviseSink2 Method
Description
OnLinkSrcChange
Advises that link source has changed.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database