Compartir a través de


URLOpenBlockingStream

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function creates a blocking type stream object from a URL and downloads the data from the Internet. When the data is downloaded, the client application or control can read it using the IStream::Read method.

Syntax

HRESULT URLOpenBlockingStream(
  LPUNKNOWN pCaller,
  LPCSTR szURL,
  LPSTREAM* ppStream,
  DWORD dwReserved,
  LPBINDSTATUSCALLBACK lpfnCB
);

Parameters

  • pCaller
    Address of the controlling IUnknown interface. If the client application or control is not a Component Object Model (COM) object or Microsoft ActiveX Control, the parameter can be set to NULL.
  • szURL
    Address of a string value containing the URL to be converted to a stream object. This parameter cannot be set to NULL.
  • ppStream
    Address of the IStream interface on the stream object created by this function. The caller can read from the stream as soon as it has this pointer.
  • dwReserved
    Reserved. Must be zero.
  • lpfnCB
    Address of the caller's IBindStatusCallback interface. This parameter can be set to NULL.

Return Value

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

Remarks

This function is synchronous and will only return after all the data has been downloaded from the Internet.

URLOpenBlockingStream calls the IBindStatusCallback::OnProgress method (if provided) on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called. Implementing IBindStatusCallback::OnProgress allows a caller to implement a user interface or other progress monitoring functionality. It also allows the download operation to be canceled by returning E_ABORT from the IBindStatusCallback::OnProgress call.

Requirements

Header urlmon.h, urlmon.idl
Library urlmon.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later