Q
qaz1znz
Unregistered / Unconfirmed
GUEST, unregistred user!
IDispatch* pACDisp
IHTMLAttributeCollection* pAttrColl
IDispatch* pItemDisp
IHTMLDOMAttribute* pItem
LONG lACLength
VARIANT vACIndex
BSTR bstrName
VARIANT vValue
VARIANT_BOOL vbSpecified
pBody->QueryInterface(IID_IHTMLDOMNode, (void**)&pElemDN)
pElemDN->get_attributes(&pACDisp)
pACDisp->QueryInterface(IID_IHTMLAttributeCollection, (void**)&pAttrColl)
pAttrColl->get_length(&lACLength)
cout < <lACLength < <endl
vACIndex.vt = VT_I4
for (int i = 0
i < lACLength
i++) { vACIndex.lVal = i
pAttrColl->item(&vACIndex, &pItemDisp)
pItemDisp->QueryInterface(IID_IHTMLDOMAttribute, (void**)&pItem)
pItem->get_specified(&vbSpecified)
pItem->get_nodeName(&bstrName)
cout < <W2A(bstrName) < <": "
pItem->get_nodeValue(&vValue)
if(vbSpecified==VARIANT_TRUE) { cout < <i
}cout < <endl
pItemDisp->Release()
pItem->Release()
} pElemDN->Release()
pACDisp->Release()
pAttrColl->Release()
这段代码中的vACIndex变量,其中有二个应用 vACIndex.vt = VT_I4
和 vACIndex.lVal = i
不知道怎么办;另AttrColl->item(&vACIndex, &pItemDisp);转后为pItemDisp:=pAttrColl.item('vACIndex');这个参数一直出错
IHTMLAttributeCollection* pAttrColl
IDispatch* pItemDisp
IHTMLDOMAttribute* pItem
LONG lACLength
VARIANT vACIndex
BSTR bstrName
VARIANT vValue
VARIANT_BOOL vbSpecified
pBody->QueryInterface(IID_IHTMLDOMNode, (void**)&pElemDN)
pElemDN->get_attributes(&pACDisp)
pACDisp->QueryInterface(IID_IHTMLAttributeCollection, (void**)&pAttrColl)
pAttrColl->get_length(&lACLength)
cout < <lACLength < <endl
vACIndex.vt = VT_I4
for (int i = 0
i < lACLength
i++) { vACIndex.lVal = i
pAttrColl->item(&vACIndex, &pItemDisp)
pItemDisp->QueryInterface(IID_IHTMLDOMAttribute, (void**)&pItem)
pItem->get_specified(&vbSpecified)
pItem->get_nodeName(&bstrName)
cout < <W2A(bstrName) < <": "
pItem->get_nodeValue(&vValue)
if(vbSpecified==VARIANT_TRUE) { cout < <i
}cout < <endl
pItemDisp->Release()
pItem->Release()
} pElemDN->Release()
pACDisp->Release()
pAttrColl->Release()
这段代码中的vACIndex变量,其中有二个应用 vACIndex.vt = VT_I4
和 vACIndex.lVal = i
不知道怎么办;另AttrColl->item(&vACIndex, &pItemDisp);转后为pItemDisp:=pAttrColl.item('vACIndex');这个参数一直出错