IDataCollectorCollection::CreateDataCollectorFromXml method (pla.h)

Creates a data collector using the specified XML.

Syntax

HRESULT CreateDataCollectorFromXml(
  BSTR           bstrXml,
  IValueMap      **pValidation,
  IDataCollector **pCollector
);

Parameters

bstrXml

A string that contains the XML of the data collector to create. For details on specifying the XML string, see the Remarks section of the data collector that you want to create.

pValidation

An IValueMap interface that you use to retrieve the validation error of each property whose value is not valid. The IValueMap::Count property is zero if there were no errors.

pCollector

An IDataCollector interface of the newly created data collector. To get the actual data collector interface requested, call the QueryInterface method.

Return value

Returns S_OK if successful.

Remarks

If the XML syntax is valid, this API will return S_OK, even if one or more properties is not valid. Those properties whose values are valid are set. Those properties whose values are not valid are set to their default value.

To determine the errors that occurred, retrieve the IValueMapItem interface for each error. The IValueMapItem::Key property contains the XPath of the element in error, for example, /AlertDataCollector/TaskArguments. The IValueMapItem::Value property contains the HRESULT associated with the error, and the IValueMapItem::Description property contains the message text associated with the error.

Typically, any errors that occur will be one of the following HRESULT values.

Error Description
PLA_S_PROPERTY_IGNORED PLA ignored the property element because the data collector does not contain the specified property.
PLA_E_PROPERTY_CONFLICT The property conflicts with another property, for example, both LogAppend and LogCircular are VARIANT_TRUE.
 

Use one of the following interface identifiers to query the IDataCollector interface for the specific data collector.

Data collector interface Interface identifier
IApiTracingDataCollector IID_IApiTracingDataCollector
IAlertDataCollector IID_IAlertDataCollector
IConfigurationDataCollector IID_IConfigurationDataCollector
IPerformanceCounterDataCollector IID_IPerformanceCounterDataCollector
ITraceDataCollector IID_ITraceDataCollector

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header pla.h
DLL Pla.dll

See also

IDataCollectorCollection

IDataCollectorCollection::CreateDataCollector