Cannot convert 'IXMLNodeList' to '_di_IXMLNodeList' 求助
void __fastcall TForm1::Button1Click(TObject *Sender)
{
String str;
_di_IXMLDocument XMLDoc;
XMLDoc = NewXMLDocument();
XMLDoc->LoadFromFile((WideString)"D:\\Request.xml");
_di_IXMLNode node = XMLDoc->DocumentElement->ChildNodes[0];//此句出错
str =readxml(node);//调用一个函数
ShowMessage(str);
}
[C++ Error]:Cannot convert 'IXMLNodeList' to '_di_IXMLNodeList'
添加了#include <XMLDoc.hpp>,并且我没用TXMLDocument控件啊,求解
[解决办法]
_di_IXMLNode node = XMLDoc->DocumentElement->ChildNodes[0];
改成:
_di_IXMLNode node = XMLDoc->DocumentElement->ChildNodes->Nodes[0];