本文整理汇总了C++中IXMLDOMDocument::put_async方法的典型用法代码示例。如果您正苦于以下问题:C++ IXMLDOMDocument::put_async方法的具体用法?C++ IXMLDOMDocument::put_async怎么用?C++ IXMLDOMDocument::put_async使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IXMLDOMDocument
的用法示例。
在下文中一共展示了IXMLDOMDocument::put_async方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetIndent
/**
* XML 파일의 형태를 Tab을 이용해서 보기 좋게 정렬한다.
* \param szIndentFileName 정렬에 사용할 스타일 시트 파일명
* return 성공 유무
*/
bool CNtlXMLDoc::SetIndent(WCHAR* szIndentFileName)
{
IXMLDOMDocument* pXSL = NULL;
CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXMLDOMDocument), (void**)&pXSL);
if(!pXSL)
return false;
VARIANT_BOOL vBool;
pXSL->put_async(VARIANT_FALSE);
pXSL->load((_variant_t)szIndentFileName, &vBool);
VARIANT vObject;
VariantInit(&vObject);
vObject.vt = VT_DISPATCH;
vObject.pdispVal = m_pXMLDocument;
m_pXMLDocument->transformNodeToObject(pXSL, vObject);
if(pXSL)
{
pXSL->Release();
pXSL = NULL;
}
return true;
}
示例2: DomFromCOM
// Helper function to create a DOM instance:
IXMLDOMDocument * DomFromCOM()
{
HRESULT hr;
IXMLDOMDocument *pxmldoc = NULL;
HRCALL( CoCreateInstance(__uuidof(DOMDocument40),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(IXMLDOMDocument),
(void**)&pxmldoc),
"Create a new DOMDocument");
HRCALL( pxmldoc->put_async(VARIANT_FALSE),
"should never fail");
HRCALL( pxmldoc->put_validateOnParse(VARIANT_FALSE),
"should never fail");
HRCALL( pxmldoc->put_resolveExternals(VARIANT_FALSE),
"should never fail");
return pxmldoc;
clean:
if (pxmldoc)
{
pxmldoc->Release();
}
return NULL;
}
示例3:
static IXMLDOMDocument *createAndConfigureInterface(void)
{
IXMLDOMDocument *xmlDoc = (IXMLDOMDocument *)ComLibrary::_createInterface(CLSID_DOMDocument30, IID_IXMLDOMDocument);
if(xmlDoc != NULL)
{
xmlDoc->put_async(VARIANT_FALSE);
xmlDoc->put_preserveWhiteSpace(VARIANT_FALSE);
xmlDoc->put_resolveExternals(VARIANT_FALSE);
xmlDoc->put_validateOnParse(VARIANT_TRUE);
}
return xmlDoc;
}
示例4: put_RecognitionParam
STDMETHODIMP CStrokeRecognition::put_RecognitionParam(BSTR newVal)
{
double Segment_Error_Threshold;
double Arc_Error_Threshold;
double Arc_Min_Length;
double Arc_Min_Curve;
double Stroke_Min_Length;
double Min_Turning_Angle;
double Segmentation_Penalty;
VARIANT value;
BSTR nodeName;
long n;
IXMLDOMDocument* pDoc;
IXMLDOMNodeList* pNodeList;
IXMLDOMNode* pNode;
IXMLDOMNode* pParamNode;
IXMLDOMNode* pAttrNode;
IXMLDOMNamedNodeMap* pNodeMap;
VARIANT_BOOL bLoaded;
GetFittingParam(Segment_Error_Threshold, Arc_Error_Threshold, Arc_Min_Length, Arc_Min_Curve, Stroke_Min_Length, Min_Turning_Angle, Segmentation_Penalty);
if (SUCCEEDED(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (LPVOID*)&pDoc)))
{
pDoc->put_async(VARIANT_FALSE);
pDoc->loadXML(newVal, &bLoaded);
if (bLoaded == VARIANT_TRUE)
{
if (SUCCEEDED(pDoc->get_childNodes(&pNodeList)))
{
pParamNode = NULL;
pNodeList->get_length(&n);
for (int i = 0; i < n; i++)
{
if (SUCCEEDED(pNodeList->get_item(i, &pNode)))
{
nodeName = NULL;
if (SUCCEEDED(pNode->get_nodeName(&nodeName)))
{
if (CComBSTR(nodeName) == L"param")
{
pParamNode = pNode;
pParamNode->AddRef();
break;
}
SysFreeString(nodeName);
}
pNode->Release();
}
}
pNodeList->Release();
if (pParamNode != NULL)
{
if (SUCCEEDED(pParamNode->get_attributes(&pNodeMap)))
{
if (SUCCEEDED(pNodeMap->getNamedItem(L"Segment_Error_Threshold", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Segment_Error_Threshold = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Arc_Error_Threshold", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Arc_Error_Threshold = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Arc_Min_Length", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Arc_Min_Length = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Arc_Min_Curve", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Arc_Min_Curve = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Stroke_Min_Length", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Stroke_Min_Length = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Min_Turning_Angle", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
Min_Turning_Angle = _wtof(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"Segmentation_Penalty", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
//.........这里部分代码省略.........
示例5: DecodePointFromXML
void CStrokeRecognition::DecodePointFromXML(std::vector<POINT> &rgPoints, BSTR strXML)
{
IXMLDOMDocument* pDoc;
IXMLDOMNodeList* pNodeList;
IXMLDOMNode* pNode;
IXMLDOMNode* pInputNode;
IXMLDOMNode* pAttrNode;
IXMLDOMNamedNodeMap* pNodeMap;
VARIANT_BOOL bLoaded;
VARIANT value;
BSTR nodeName;
POINT pt;
long n;
if (SUCCEEDED(CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (LPVOID*)&pDoc)))
{
pDoc->put_async(VARIANT_FALSE);
pDoc->loadXML(strXML, &bLoaded);
if (bLoaded == VARIANT_TRUE)
{
if (SUCCEEDED(pDoc->get_childNodes(&pNodeList)))
{
pInputNode = NULL;
pNodeList->get_length(&n);
for (int i = 0; i < n; i++)
{
if (SUCCEEDED(pNodeList->get_item(i, &pNode)))
{
nodeName = NULL;
if (SUCCEEDED(pNode->get_nodeName(&nodeName)))
{
if (CComBSTR(nodeName) == L"input")
{
pInputNode = pNode;
pInputNode->AddRef();
break;
}
SysFreeString(nodeName);
}
pNode->Release();
}
}
pNodeList->Release();
if (pInputNode != NULL)
{
if (SUCCEEDED(pInputNode->get_childNodes(&pNodeList)))
{
pNodeList->get_length(&n);
for (int i = 0; i < n; i++)
{
if (SUCCEEDED(pNodeList->get_item(i, &pNode)))
{
pt.x = 0;
pt.y = 0;
if (SUCCEEDED(pNode->get_attributes(&pNodeMap)))
{
if (SUCCEEDED(pNodeMap->getNamedItem(L"x", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
pt.x = _wtoi(value.bstrVal);
pAttrNode->Release();
}
if (SUCCEEDED(pNodeMap->getNamedItem(L"y", &pAttrNode)))
{
pAttrNode->get_nodeValue(&value);
pt.y = _wtoi(value.bstrVal);
pAttrNode->Release();
}
pNodeMap->Release();
}
rgPoints.push_back(pt);
pNode->Release();
}
}
pNodeList->Release();
}
pInputNode->Release();
}
}
}
pDoc->Release();
}
}
示例6: XmlLoadDocumentFromFileEx
/*******************************************************************
XmlLoadDocumentFromFileEx
********************************************************************/
extern "C" HRESULT DAPI XmlLoadDocumentFromFileEx(
__in_z LPCWSTR wzPath,
__in DWORD dwAttributes,
__out IXMLDOMDocument** ppixdDocument
)
{
HRESULT hr = S_OK;
VARIANT varPath;
VARIANT_BOOL vbSuccess = 0;
IXMLDOMDocument* pixd = NULL;
IXMLDOMParseError* pixpe = NULL;
::VariantInit(&varPath);
varPath.vt = VT_BSTR;
varPath.bstrVal = ::SysAllocString(wzPath);
ExitOnNull(varPath.bstrVal, hr, E_OUTOFMEMORY, "failed to allocate bstr for Path in XmlLoadDocumentFromFileEx");
hr = XmlCreateDocument(NULL, &pixd);
if (hr == S_FALSE)
{
hr = E_FAIL;
}
ExitOnFailure(hr, "failed XmlCreateDocument");
if (dwAttributes & XML_LOAD_PRESERVE_WHITESPACE)
{
hr = pixd->put_preserveWhiteSpace(VARIANT_TRUE);
ExitOnFailure(hr, "failed put_preserveWhiteSpace");
}
// Avoid triggering anything external.
hr = pixd->put_validateOnParse(VARIANT_FALSE);
ExitOnFailure(hr, "failed put_validateOnParse");
hr = pixd->put_resolveExternals(VARIANT_FALSE);
ExitOnFailure(hr, "failed put_resolveExternals");
pixd->put_async(VARIANT_FALSE);
hr = pixd->load(varPath, &vbSuccess);
if (S_FALSE == hr)
{
hr = HRESULT_FROM_WIN32(ERROR_OPEN_FAILED);
}
if (FAILED(hr) && S_OK == pixd->get_parseError(&pixpe))
{
XmlReportParseError(pixpe);
}
ExitOnFailure1(hr, "failed to load XML from: %ls", wzPath);
if (ppixdDocument)
{
*ppixdDocument = pixd;
pixd = NULL;
}
hr = S_OK;
LExit:
ReleaseVariant(varPath);
ReleaseObject(pixd);
ReleaseObject(pixpe);
return hr;
}