Compartir a través de


SetProperty (IXmlReader)

 

Sets the specified property.

Syntax

  
HRESULT SetProperty ([in] UINT nProperty, [in] LONG_PTR pValue);  

Arguments

nProperty
The Enum that identifies the property to be set.

pValue
The property value.

Return Value

Returns S_OK if no error is generated. If an invalid property name is passed, returns E_NOTIMPL.

Remarks

For information about the properties this method can set, see IXmlReader Properties.

A program should only set properties before parsing starts—that is, before the first call to Read.

The following code sets the XmlReaderProperty_DtdProcessing property to prohibit DTDs.

if (FAILED(hr = pReader->SetProperty(XmlReaderProperty_DtdProcessing, DtdProcessing_Prohibit)))  
{  
    wprintf(L"Error setting XmlReaderProperty_DtdProcessing, error is %08.8lx", hr);  
    return -1;  
}  

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

IXmlReader Methods
GetProperty (IXmlReader)