Contents Index Topic Contents | ||
Previous Topic: IBindStatusCallback::GetPriority Next Topic: IBindStatusCallback::OnLowResource |
IBindStatusCallback::OnDataAvailable
HRESULT OnDataAvailable( [in] DWORD grfBSCF, [in] DWORD dwSize, [in] FORMATETC *pfmtetc, [in] STGMEDIUM *pstgmed );Provides data to the client as it becomes available during asynchronous bind operations.
- Returns S_OK if successful, or E_INVALIDARG if one or more parameters are invalid.
- grfBSCF
- DWORD value taken from the BSCF enumeration indicating the kind of data available.
- dwSize
- Size, in bytes, of total data available from the current bind operation.
- pfmtetc
- Address of the FORMATETC structure that indicates the format of the available data. This parameter is used when the bind operation is a result of the IMoniker::BindToStorage method. If there is no format associated with the available data, pfmtetc might contain CF_NULL. Each different call to IBindStatusCallback::OnDataAvailable can pass in a new value for this parameter, although they all should always point to the same data.
- pstgmed
- Address of the STGMEDIUM structure that contains the pointers to the interfaces (such as IStream and IStorage) that can be used to access the data. In the asynchronous case, client applications may have received a second pointer to the IStream or IStorage interface from the IMoniker::BindToStorage method, upon which the client application must call IUnknown::Release to avoid memory leaks.
During asynchronous IMoniker::BindToStorage bind operations, an asynchronous moniker calls this method to provide data to the client as it becomes available.
Note that the behavior of the storage returned in pstgmed depends on the BINDF flags returned in the IBindStatusCallback::GetBindInfo method. This storage can be asynchronous or blocking, and the bind operation can follow a data pull model or a data push model. Furthermore, it is important to note that for BINDF_PULLDATA bind operations, it is not possible to seek backward into data streams provided in IBindStatusCallback::OnDataAvailable. On the other hand, for data push model bind operations, it is commonly possible to seek back into a data stream and read any data that has been downloaded for an ongoing IMoniker::BindToStorage operation.
See also BINDF, BSCF, IBindStatusCallback::GetBindInfo
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.