URLOpenPullStream function

Creates a pull type stream object from a URL.


HRESULT URLOpenPullStream(
             LPUNKNOWN            pCaller,
             LPCSTR               szURL,
  _Reserved_ DWORD                dwReserved,


  • pCaller
    A pointer to the controlling IUnknown interface of the calling ActiveX component, if the caller is an ActiveX component. If the caller is not an ActiveX component, this value can be set to NULL. Otherwise, the caller is a COM object that is contained in another component, such as an ActiveX control in the context of an HTML page. This parameter represents the outermost IUnknown of the calling component. The function attempts the download in the context of the ActiveX client framework, and allows the caller container to receive callbacks on the progress of the download.

  • szURL
    A string containing the URL to be converted to a stream object. Cannot be set to NULL.

  • dwReserved
    Reserved. Must be set to 0.

  • lpfnCB
    A pointer to the caller IBindStatusCallback interface, on which URLOpenPullStream calls IBindStatusCallback::OnDataAvailable when data arrives from the Internet. The download operation can be canceled by returning E_ABORT from the IBindStatusCallback::OnDataAvailable call.

Return value

Returns S_OK if the operation succeeded, or E_OUTOFMEMORY if there is insufficient memory to complete the operation.


The pull model is more cumbersome than the push model, but it allows the client to control the amount of Internet access for the download.

The data is downloaded from the Internet on demand. If not enough data is available locally to satisfy the requests, the IStream::Read call will not block until enough data arrives. Instead, IStream::Read immediately returns E_PENDING, and URLOpenPullStream requests the next packet of data from the Internet server.


Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server


Internet Explorer 3.0







Unicode and ANSI names

URLOpenPullStreamW (Unicode) and URLOpenPullStreamA (ANSI)