0 out of 1 rated this helpful Rate this topic

SHCreateStreamOnFile function

Opens or creates a file and retrieves a stream to read or write to that file.

Note  This function has been replaced by SHCreateStreamOnFileEx.

Syntax

HRESULT SHCreateStreamOnFile(
  __in   LPCTSTR pszFile,
  __in   DWORD grfMode,
  __out  IStream **ppstm
);

Parameters

pszFile [in]

Type: LPCTSTR

A pointer to a null-terminated string that specifies the file name.

grfMode [in]

Type: DWORD

One or more STGM values that are used to specify the file access mode and how the object that exposes the stream is created and deleted.

ppstm [out]

Type: IStream**

Receives an IStream interface pointer for the stream associated with the file.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Note  This function is available through Windows XP and Windows Server 2003. It might be altered or unavailable in subsequent versions of Windows. Use SHCreateStreamOnFileEx instead.

SHCreateStreamOnFileEx fully supports all STGM modes and allows the caller to specify file attributes if creating a new file.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 5.0 or later)

Unicode and ANSI names

SHCreateStreamOnFileW (Unicode) and SHCreateStreamOnFileA (ANSI)

 

 

Send comments about this topic to Microsoft

Build date: 9/7/2011

Did you find this helpful?
(2000 characters remaining)
Community Content Add
Annotations FAQ