Re: put_scrollTop only work once!
- From: "cjsk81@xxxxxxxxx" <cjsk81@xxxxxxxxx>
- Date: 22 Feb 2006 12:29:26 -0800
Sorry about this, but I´ve been changing this code all day trying to
make it work, well I've made the changes, but I had no clue how using
SysAllocString, so i just passed am CComBSTR instead, here is how it
is;
CComPtr<IHTMLElementCollection> pHtmlEleCol;
m_pHtmlDocument2->get_all(&pHtmlEleCol);
if(!pHtmlEleCol)
{
return;
}
long uTotal = 0;
pHtmlEleCol->get_length(&uTotal);
CComPtr <IDispatch> pDisCol;
CComVariant var, varEmpty;
var.vt = VT_BSTR;
var.bstrVal = CComBSTR("SPAN");
pHtmlEleCol->tags(var,&pDisCol);
SysFreeString(var.bstrVal);
if(pDisCol)
{
CComPtr<IHTMLElementCollection> pSpanCol;
pDisCol.QueryInterface(&pSpanCol);
if(pSpanCol)
{
long uLen = 0;
pSpanCol->get_length(&uLen);
if(uLen > 0)
{
memset(&var,0,sizeof(VARIANT));
memset(&varEmpty,0,sizeof(VARIANT));
varEmpty.vt = VT_EMPTY;
var.vt = VT_I4;
var.iVal = uLen-1;
CComPtr <IDispatch> pDisEle;
pSpanCol->item(var,varEmpty,&pDisEle);
if(pDisEle)
{
CComPtr <IHTMLElement> pEle;
pDisEle.QueryInterface(&pEle);
if(pEle)
{
CComVariant vScroll;
vScroll.vt = VT_BOOL;
vScroll.boolVal = TRUE;
CComBSTR bstr;
pEle->get_innerText(&bstr);
hr = pEle->scrollIntoView(vScroll);
}
}
}
}
}
.
- Follow-Ups:
- Re: put_scrollTop only work once!
- From: Igor Tandetnik
- Re: put_scrollTop only work once!
- From: cjsk81@xxxxxxxxx
- Re: put_scrollTop only work once!
- References:
- put_scrollTop only work once!
- From: cjsk81@xxxxxxxxx
- Re: put_scrollTop only work once!
- From: Igor Tandetnik
- Re: put_scrollTop only work once!
- From: cjsk81@xxxxxxxxx
- Re: put_scrollTop only work once!
- From: Igor Tandetnik
- Re: put_scrollTop only work once!
- From: cjsk81@xxxxxxxxx
- Re: put_scrollTop only work once!
- From: Igor Tandetnik
- put_scrollTop only work once!
- Prev by Date: Re: put_scrollTop only work once!
- Next by Date: Re: put_scrollTop only work once!
- Previous by thread: Re: put_scrollTop only work once!
- Next by thread: Re: put_scrollTop only work once!
- Index(es):
Relevant Pages
|
|