次の方法で共有


SetProperty (IXmlWriter)

 

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 IXmlWriter Properties.

After writing starts, it is not recommended that you call this method.

The following code shows the use of SetProperty:

if (FAILED(hr = pWriter->SetProperty(XmlWriterProperty_Indent, TRUE)))  
{  
    wprintf(L"Error, Method: SetProperty XmlWriterProperty_Indent, error is %08.8lx", hr);  
    return -1;  
}  

Requirements

Header: XmlLite.h

Library: XmlLite.lib

See Also

IXmlWriter Methods