Поделиться через


URLOpenStream function

Creates a push type stream object from a URL.

Syntax

HRESULT URLOpenStream(
             LPUNKNOWN            pCaller,
             LPCSTR               szURL,
  _Reserved_ DWORD                dwReserved,
             LPBINDSTATUSCALLBACK lpfnCB
);

Parameters

  • 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 URLOpenStream 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.

Remarks

The data is downloaded from the Internet as fast as possible. When data is available, it is pushed at the client through a notification callback.

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

URLOpenStreamW (Unicode) and URLOpenStreamA (ANSI)