IAdviseSink2  13S1QGS

The IAdviseSink2 interface is an extension of IAdviseSink3F9W.KC, adding the method OnLinkSrcChange to the contract to handle a change in the moniker of a linked object. This avoids overloading the implementation IAdviseSink::OnRename4.U2Y5P to handle the renaming of both embedded objects and linked objects. 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.

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. In general, your code would implement just IAdviseSink2, which, because of contract inheritance, must include implementations of all of the IAdviseSink3F9W.KC methods, along with the single additional method of IAdviseSink2.

When to Use

When a link source is renamed, the link object should notify its container by calling IAdviseSink::OnLinkSrcChange. If you are using the default handler, containing the OLE link object, you can still have both embedded and linked objects call IAdviseSink::OnRename, but for linked objects, the OLE link object maps the notification to IAdviseSink2::OnLinkSrcChangeI385DB.

Methods in Vtable Order

IUnknown Methods

Description

QueryInterface2Y54585

Returns pointers to supported interfaces.

AddRef1SHW0SS

Increments reference count.

ReleaseDUW01A

Decrements reference count.

 

IAdviseSink Methods

Description

OnDataChangeRBSVUI

Advises that data has changed.

OnViewChange11_6YI7

Advises that view of object has changed.

OnRename4.U2Y5P

Advises that name of object has changed.

OnSaveUEGG9W

Advises that object has been saved to disk.

OnCloseRFOKVA

Advises that object has been closed.

 

IAdviseSink2 Method

Description

OnLinkSrcChangeI385DB

Advises that link source has changed.