Udostępnij za pośrednictwem


URLOpenBlockingStream 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 by using the IStream::Read method.

Syntax

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

Parameters

  • pCaller
    A pointer to the controlling IUnknown interface. If the client application or control is not a COM object or a ActiveX control, the parameter can be set to NULL.

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

  • ppStream
    A pointer to 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 set to 0.

  • lpfnCB
    A pointer to the caller IBindStatusCallback interface. Can be set to NULL.

Return value

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

Remarks

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

If the IBindStatusCallback::OnProgress method is provided, URLOpenBlockingStream calls the method on a connection activity, including the arrival of data. IBindStatusCallback::OnDataAvailable is never called. By using IBindStatusCallback::OnProgress, a caller can implement a user interface or other progress monitoring functionality. The download operation can be canceled by returning E_ABORT from the IBindStatusCallback::OnProgress call.

Note  URLOpenBlockingStream should not be used with protocols that do not return content, such as mailto.

 

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Product

Internet Explorer 3.0

Header

Urlmon.h

Library

Urlmon.lib

DLL

Urlmon.dll

Unicode and ANSI names

URLOpenBlockingStreamW (Unicode) and URLOpenBlockingStreamA (ANSI)