Index   Commented   Search   About

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.

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder

More Online Helps

Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (sock2.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun