IOpcPart::GetContentStream method

Gets a stream that provides read/write access to part content.

Syntax


HRESULT GetContentStream(
  [out, retval]  IStream **stream
);

Parameters

stream [out, retval]

A pointer to the IStream interface of a stream that provides read and write access to part content.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return codeDescription
S_OK

The method succeeded.

E_POINTER

The stream parameter is NULL.

CreateFile function error

An HRESULT error code from the CreateFile function, which is returned as a result of attempting to allocate disk space for part data if the package was opened using the OPC_CACHE_ON_ACCESS read flag.

Package Consumption error

An HRESULT error code from the Package Consumption Error Group.

Part URI error

An HRESULT error code from the Part URI Error Group.

 

Remarks

For more information about parts, see the Open Packaging Conventions Fundamentals and the ECMA-376 OpenXML, 1st Edition, Part 2: Open Packaging Conventions (OPC).

Thread Safety

Packaging objects are not thread-safe.

For more information, see the Getting Started with the Packaging API.

Requirements

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]

Header

Msopc.h

IDL

Opcobjectmodel.idl

See also

IOpcPart
Overviews
Getting Started with the Packaging API
Open Packaging Conventions Fundamentals
Parts Overview
Reference
IOpcPartSet
Packaging Errors
Packaging API Reference
Packaging API Samples
External Resources
ECMA-376 OpenXML standard

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.