VOID XXX_XML() { IXMLDOMDocumentPtr pXmlDocument; if ( pXmlDocument.CreateInstance(__uuidof(XML::DOMDocument)) != S_OK ) { return; } // Do load IXMLDOMElementPtr xmlNode = pXmlDocument->selectSingleNode(_bstr_t("PROGRAM/INFO/SECTION")); WCHAR* strFiled[2] = {L"strBaseVer",L"strRemark"}; for (int id = 0; id < 2; id++) { IXMLDOMAttributePtr paA = NULL; _bstr_t bstrA = SysAllocString(strFiled[id]); paA = pXmlDocument->createAttribute(bstrA); VARIANT vrValue = (_variant_t)(_bstr_t)(L"noused"); paA->put_value(vrValue); xmlNode->setAttributeNode(paA); } return; }