# IDataAdviseHolder::SendOnDataChange

Sends notifications to each advise sink for which there is a connection established by calling the IAdviseSink::OnDataChange method for each advise sink currently being handled by this instance of the advise holder object.

HRESULT SendOnDataChange(

IDataObject * pDataObject, | //Pointer to the data object that has changed
DWORD dwReserved, | //Reserved
DWORD advf | //Advise flags
); |

Parameters

pDataObject
  [in] Pointer to the IDataObject interface on the data object in which the data has just changed. This pointer is used in subsequent calls to IAdviseSink::OnDataChange.
dwReserved
  [in] Reserved for future use; must be zero.
advf
  [in] Container for advise flags that specify how the call to IAdviseSink::OnDataChange is made. These flag values are from the enumeration ADVF. Typically, the value for advf is NULL. The only exception occurs when the data object is shutting down and must send a final notification that includes the actual data to sinks that have specified ADVF_DATAONSTOP and ADVF_NODATA in their call to IDataObject::DAdvise. In this case, advf contains ADVF_DATAONSTOP.

Return Values

This method supports the standard return value E_OUTOFMEMORY, as well as the following:

S_OK
  The call to IAdviseSink::OnDataChange was made.

Remarks

The data object must call this method when it detects a change that would be of interest to an advise sink that has previously requested notification.

Most notifications include the actual data with them. The only exception is if the ADVF_NODATA flag was previously specified when the connection was initially set up in the IDataAdviseHolder::Advise method.

Before calling the IAdviseSink::OnDataChange method for each advise sink, this method obtains the actual data by calling the IDataObject::GetData method through the pointer specified in the pDataObject parameter.

See Also

ADVF, IAdviseSink::OnDataChange