W
warmfish
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
TOLEBOOL bSuccess=0;
HRESULT hr;
Msxml2_tlb::IXMLDOMDocument* pXMLDoc=NULL;
Msxml2_tlb::IXMLDOMNodeList *pNodeList=NULL;
hr=CoInitialize(NULL);
//COM的初始化
//得到关于IXMLDOMDocument接口的指针pXMLDOC。
hr=CoCreateInstance(Msxml2_tlb::CLSID_DOMDocument,
NULL,
CLSCTX_INPROC_SERVER,
Msxml2_tlb::IID_IXMLDOMDocument,
(void**)&pXMLDoc);
WideString wsTemp="<?xml version=/"1.0/"?>/
<Tip> /
<Mode> /
<a>ff</a> /
</Mode> /
</Tip>";
bSuccess=pXMLDoc->loadXML(wsTemp);
if(bSuccess)
{
pNodeList=pXMLDoc->getElementsByTagName(WideString("Tip");
int iNumber=pNodeList->get_length();
....
}
问题: iNumber=0 ,为什么? 谢谢!
TOLEBOOL bSuccess=0;
HRESULT hr;
Msxml2_tlb::IXMLDOMDocument* pXMLDoc=NULL;
Msxml2_tlb::IXMLDOMNodeList *pNodeList=NULL;
hr=CoInitialize(NULL);
//COM的初始化
//得到关于IXMLDOMDocument接口的指针pXMLDOC。
hr=CoCreateInstance(Msxml2_tlb::CLSID_DOMDocument,
NULL,
CLSCTX_INPROC_SERVER,
Msxml2_tlb::IID_IXMLDOMDocument,
(void**)&pXMLDoc);
WideString wsTemp="<?xml version=/"1.0/"?>/
<Tip> /
<Mode> /
<a>ff</a> /
</Mode> /
</Tip>";
bSuccess=pXMLDoc->loadXML(wsTemp);
if(bSuccess)
{
pNodeList=pXMLDoc->getElementsByTagName(WideString("Tip");
int iNumber=pNodeList->get_length();
....
}
问题: iNumber=0 ,为什么? 谢谢!