|
IDataAdviseHolder::Advise
Creates a connection between an advise sink and a data object for receiving
notifications.
HRESULT Advise(
IDataObject * pDataObject,
| //Specifies the data object for which notifications are requested
| FORMATETC * pFormatetc,
| //Description of data that is of interest to the advise sink
| DWORD advf,
| //Flags that specify how the notification takes place
| IAdviseSink * pAdvSink,
| //The advise sink requesting notification
| DWORD * pdwConnection
| //Identifies the connection for future calls to the Unadvise method
| );
|
|
Parameters
pDataObject
[in]Points to the data object for which notifications are requested. If data
in this object changes, a notification is sent to the advise sinks that have
requested notification.
pFormatetc
[in]Points to the specified format, medium, and target device that is of
interest to the advise sink requesting notification. For example, one sink may want
to know only when the bitmap representation of the data in the the data object
changes. Another sink may be interested in only the metafile format of the same
object. Each advise sink is notified when the data of interest changes. This
data is passed back to the advise sink when notification occurs.
advf
[in]Contains a group of flags for controlling the advisory connection. Valid
values are from the enumeration ADVF. However, only some of the possible ADVF values are relevant for this method. The following table briefly describes
the relevant values; a more detailed description can be found in the description
of the ADVF enumeration.
ADVF Value
| Description
| ADVF_NODATA
| Asks that no data be sent along with the notification.
| ADVF_ONLYONCE
| Causes the advisory connection to be destroyed after the first notification is
sent. An implicit call to IDataAdviseHolder::Unadvise is made on behalf of the caller to remove the connection.
| ADVF_PRIMEFIRST
| Causes an initial notification to be sent regardless of whether or not data
has changed from its current state.
| ADVF_DATAONSTOP
| When specified with ADVF_NODATA, this flag causes a last notification with the
data included to be sent before the data object is destroyed. When ADVF_NODATA
is not specified, this flag has no effect.
|
pAdvSink
[in]Points to the advisory sink that receives the change notification.
pdwConnection
[in]Points to the location of a returned token that identifies this connection
and can later be used to delete the advisory connection. It deletes the
connection by passing it to IDataAdviseHolder::Unadvise. If this value is zero, the connection was not established.
Return Values
S_OK
The advisory connection was created.
E_INVALIDARG
One or more arguments are invalid.
Comments
Through the connection established through this method, the advisory sink can
receive future notifications in a call to IAdviseSink::OnDataChange.
An object issues a call to IDataObject::DAdvise to request notification on changes to the format, medium, or target device of
interest. This data is specified in the pFormatetc parameter. The DAdvise method in turn calls IDataAdviseHolder::Advise and delegates the task of setting up and tracking a connection to the advise
holder. When the format, medium, or target device in question changes, the data
object calls IDataAdviseHolder::SendOnDataChange to actually send the necessary notifications.
The established connection can be deleted by passing the value in pdwConnection to IDataAdviseHolder::Unadvise.
See also
ADVF, CreateDataAdviseHolder, FORMATETC, IDataAdviseHolder::Unadvise, IDataObject::DAdvise
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|