Share via


CreateXmlReaderInputWithEncodingCodePage (Compact 7)

3/12/2014

This function creates an instance of IXmlReaderInput with the provided parameters.

Syntax

HRESULT CreateXmlReaderInputWithEncodingCodePage (
    ISequentialStream* pInputStream,
    IMalloc* pMalloc,
    UINT nEncodingCodePage,
    BOOL fEncodingHint,
    const WCHAR* pwszBaseUri,
    IXmlReaderInput** ppInput
);

Arguments

  • pInputStream
    [in] A pointer to the input stream for the reader to read the data from. This can be either an ISequentialStream or an IStream interface. We recommend that the IStream interface be implemented for the stream even if some of its methods would return E_NOTIMPL. We also recommend that the stat method be implemented so that the size of the stream can be queried, because this can result in better performance.

    This parameter cannot be NULL.

  • pMalloc
    [in] A pointer to a user-provided implementation of the IMalloc interface. The reader will use this for all memory allocation. If this parameter is NULL, the reader will use its own implementation.
  • nEncodingCodePage
    [in] Specifies the encoding of the input. The user can specify the encoding as a codepage number. The actual behavior of the reader depends on the fEncodingHint flag. A value of zero indicates an unknown code page.
  • fEncodingHint
    [in] If TRUE, the parser tries to use the encoding specified in pwszEncodingName. If the encoding of the file differs from that specified in pwszEncodingName, the parser will try to determine the encoding. If FALSE, the parser must use the encoding specified in pwszEncodingName. Any other encoding results in an error.
  • pwszBaseUri
    [in] The base URI for this input stream. This value is passed to ResolveUri when XmlLite is resolving external entities.

Return Value

This function returns S_OK if no error is generated.

Remarks

To set the base URI for the input stream when the encoding (input) code page is not known, set the nEncodingCodePage parameter to zero.

See Also

Reference

Functions
ISequentialStream
IStream
IMalloc
ResolveUri
IXmlReaderInput
Error Codes