获取 xml 节点文本,一下方式如果遇到很长的文本(如CRichEditCtrl 的 rtf 流)则无法返回正确值
MSXML2::IXMLDOMNodePtr m_spCurrentNode;
for(INT i=0;i<m_spCurrentNode->childNodes->length;i++)
{
if(m_spCurrentNode->childNodes->item[i]->nodeType ==MSXML2::NODE_TEXT)
{
str1 = m_spCurrentNode->childNodes->item[i]->text;
strNodeValue = str1;
break;
}
//spOldNode->childNodes->item[i]->text = strNodeValue.AllocSysString();
}
>> 改为 >>
m_spCurrentNode->get_text(&str1);
strNodeValue = str1;
即可