Compartilhar via


IConfigManager::ProcessDocument (Compact 2013)

3/26/2014

This method starts processing XML to configure settings on a device.

Syntax

virtual HRESULT STDMETHODCALLTYPE ProcessDocument( 
    IXMLDOMNode *nodeXML,
    DWORD dwFlags
) = 0;

Parameters

  • nodeXML
    [in] The IXMLDOMNode interface pointer that represents the top node of the XML file.
  • dwFlags
    [in] One or more of the following action flags:

    Flag

    Value

    Description

    CFGFLAG_PROCESS

    0x0001

    The configuration management service and configuration service providers process the XML input data.

    CFGFLAG_METADATA

    0x0002

    The configuration management service gathers and returns metadata for any XML <parm> elements it finds.

Return Value

Returns an HRESULT that indicates NOERROR if successful; otherwise, returns one of the following error codes.

Error code

Description

E_INVALIDARG

The XML is invalid.

E_OUTOFMEMORY

Exceeded available memory.

CONFIG_E_TRANSACTIONINGFAILURE

The commit/rollback operation did not succeed.

Remarks

DOMDocument derives from IXMLDOMNode. You can call its loadXML Method to load an XML string into an XML document object.

Code Example

Description

The following example code shows how to use the ProcessDocument method to load an XML file for the Clock configuration service provider.

Important

For readability, the following code example does not contain security checking or error handling. Do not use the following code in a production environment.

Code

#include "cfgmgr.h"

IXMLDOMDocument *   pDoc    = NULL;
IXMLDOMNode *       pNode   = NULL;
VARIANT_BOOL        isSuccessful;
TCHAR szClockQuery[] = TEXT("<wap-provisioningdoc><characteristic type=\"Clock\"><parm-query name=\"Time\"/></characteristic></wap-provisioningdoc>");

    CHR(CoCreateInstance(__uuidof(DOMDocument), NULL, CLSCTX_INPROC_SERVER,
                         __uuidof(IXMLDOMDocument), (void**)&pDoc));

    // Load the XML string into the document
CHR(pDoc->loadXML(szClockQuery, &isSuccessful));

    if(!isSuccessful) {
        // Failed to parse XML
        CHR(CONFIG_E_BAD_XML);
    }

    // Get the topmost node of the document
    CHR(pDoc->QueryInterface(__uuidof(IXMLDOMNode), (void**)&pNode));

    hr = pConfigMgr->ProcessDocument(pNode, CFGFLAG_PROCESS);
    CHR(hr);

Requirements

Header

cfgmgr.h,
msxml2.h,
msxml2.idl

sysgen

SYSGEN_CONFIGMGR

See Also

Reference

IConfigManager
Configuration Service Provider Reference