CAsyncMonikerFile::OnDataAvailable

virtual void OnDataAvailable( DWORD dwsize, DWORD bscfFlag );

Parameters

dwsize

The cumulative amount (in bytes) of data available since the beginning of the binding. Can be zero, indicating that the amount of data is not relevant to the operation, or that no specific amount became available.

bscfFlag

A BSCF enumeration value. Can be one or more of the following values:

Remarks

An asynchronous moniker calls OnDataAvailable to provide data to the client as it becomes available, during asynchronous bind operations. The default implementation of this function does nothing. See the following example for a sample implementation.

Example

// refer to CDataPathProperty.
void CAsyncMyTextProperty::OnDataAvailable(DWORD dwSize, DWORD bscfFlag)
{
   if ((bscfFlag & BSCF_FIRSTDATANOTIFICATION) != 0)
   {
      m_dwReadBefore = 0;
      m_strText.Empty();
   }

   DWORD dwArriving = dwSize - m_dwReadBefore;

   if (dwArriving > 0)
   {
      int nLen = m_strText.GetLength();
      ASSERT(nLen == m_dwReadBefore);
      LPTSTR psz = m_strText.GetBuffer(nLen + dwArriving);
      Read(psz + nLen, dwArriving);
      m_strText.ReleaseBuffer(nLen + dwArriving);
      m_dwReadBefore = dwSize;
      GetControl()->Invalidate();
   }
}

CAsyncMonikerFile OverviewClass MembersHierarchy Chart

See Also   CDataPathProperty