Serializes a package that is represented by a package object.
HRESULT WritePackageToStream( IOpcPackage *package, OPC_WRITE_FLAGS flags, IStream *stream );
A pointer to the IOpcPackage interface of the package object that contains data to be serialized.
The value that describes the encoding method used in serialization.
A pointer to the IStream interface of the stream where the package object data will be written.
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
||The method succeeded.|
||The value passed in the flags parameter is not a valid OPC_WRITE_FLAGS enumeration value.|
||This method is not implemented for this version of Windows.|
||At least one of the stream and package parameters is NULL.|
||An HRESULT error code from the IStream interface.|
||An HRESULT error code from the Package Consumption Error Group.|
||An HRESULT error code from the Part URI Error Group.|
Do not use a stream to serialize package data when the same stream is being used to deserialize a package, because the attempt may result in undefined behavior.
For information about how to use this method to save a package that is represented as a package object, see the Saving a Package programming task.Getting Started with the Packaging API, and Platform Update for Windows Vista.
Packaging objects are not thread-safe.
For more information, see the Getting Started with the Packaging API.
|Windows version||Windows 7 [desktop apps only] Windows Server 2008 R2 [desktop apps only]|