为什么(spDoc.body as IHTMLElement2).scrollLeft返回总是0?
在Delphi中:
spDoc: IHTMLDocument2;
(spDoc.body as IHTMLElement2).scrollLeft返回值总是0?
上面用VC写也是一样的,
IHTMLDocument2 spDoc;
IHTMLElement spBody;
IHTMLElement2 spElem2;
spWB->get_Document(&spDoc);
spDoc->get_body(&spBody);
if (spBody->QueryInterface(IHTMLElement2, spElem2) != S_OK)
return;
(临时写的,有错请见谅)
网页出现了滚动条,我也的确滚动到了某个位置,可返回值依然为0,不知为何,spDoc, body 的值都是对的(上面代码是为了提问而简化的)