Share via


SetOutput (Compact 7)

3/12/2014

This method sets the output stream for the writer.

Syntax

HRESULT SetOutput (
  IUnknown* pOutput
);

Arguments

  • pOutput
    The output stream for the writer

Return Value

This method returns S_OK if no error is generated.

Remarks

IXmlWriter can accept several kinds of output stream:

  • A class derived from ISequentialStream
    The writer will write the output to the provided ISequentialStream by using the default UTF-8 encoding.
  • A class derived from IStream
    The writer will write the output to the provided IStream by using the default UTF-8 encoding.
  • IXmlWriterOutput
    The writer will write the output to the stream and encoding specified by the IXmlWriterOutput object.
  • NULL
    This resets the writer, releasing the previously set output object. This forces the writer to flush all the data into the stream, but does not force the stream itself to flush.

Use the Flush method to force the writer to write out all the buffered data to the output stream.

See Also

Reference

IXmlWriter Methods
IXmlWriter
ISequentialStream
IStream
IXmlWriterOutput
Flush
IXmlWriter Properties