'MSHTML::IHTMLElementCollection::item' : function does not take 3 arguments

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
hi,all, I have the following code:

<div style="color:Black;background-color:White; <pre>
MSHTML::IHTMLDocument2Ptr pDoc;
MSHTML::IHTMLElementPtr pElem;
CComPtr<IDispatch> pElemDisp = NULL;
<span style="color:Blue; long lLength;
MSHTML::IHTMLElementCollectionPtr pChElemColl = NULL;

pDoc->get_body(&pElemBody);
pElem->get_children(&pElemDisp);
pElemDisp->QueryInterface(IID_IHTMLElementCollection, (VOID**)&pChElemColl);
pChElemColl->get_length(&lLength);

<span style="color:Blue; for(<span style="color:Blue; int i = 0; i < lLength; i++)
{
VARIANT varIndex;
varIndex.vt = VT_UINT;
varIndex.lVal = i;
VARIANT var2;
VariantInit(&var2);
CComPtr<IDispatch> pDisp = NULL;

hr = pChElemColl->item(varIndex, var2, &pDisp);
<span style="color:Green; // and so on
}
[/code]

but, got a compiling error

<pre>MSHTML::IHTMLElementCollection::item : function does not take 3 arguments [/code]

how to fix this?
cheers
daiyue

View the full article
 
Back
Top