IAdviseSink2 interface

The IAdviseSink2 interface is an extension of the IAdviseSink interface, adding the method OnLinkSrcChange to the contract to handle a change in the moniker of a linked object. This avoids overloading the implementation IAdviseSink::OnRename 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 IAdviseSink 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 OnLinkSrcChange. If you are using the default handler, containing the OLE link object, you can still have both embedded and linked objects call OnRename, but for linked objects, the OLE link object maps the notification to OnLinkSrcChange.

Members

The IAdviseSink2 interface inherits from IAdviseSink. IAdviseSink2 also has these types of members:

Methods

The IAdviseSink2 interface has these methods.

MethodDescription
OnLinkSrcChange

Advises that link source has changed.

 

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

ObjIdl.h

IDL

ObjIdl.idl

IID

IID_IAdviseSink2 is defined as 00000151-0000-0000-C000-000000000046

 

 

Community Additions

ADD
Show:
© 2014 Microsoft