This documentation is archived and is not being maintained.


An asynchronous moniker calls OnDataAvailable to provide data to the client as it becomes available, during asynchronous bind operations.

virtual void OnDataAvailable( 
   DWORD dwSize, 
   DWORD bscfFlag  



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.


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

  • BSCF_FIRSTDATANOTIFICATION   Identifies the first call to OnDataAvailable for a given bind operation.

  • BSCF_INTERMEDIATEDATANOTIFICATION   Identifies an intermediary call to OnDataAvailable for a bind operation.

  • BSCF_LASTDATANOTIFICATION   Identifies the last call to OnDataAvailable for a bind operation.

The default implementation of this function does nothing. See the following example for a sample implementation.

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

   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;