请大虾指点,救命呀(IHTMLFramesCollection的难题)
以下程序,我试图遍历网页中的所有frame
procedure TForm1:WorkOnFrame(doc, IHtmlDocument2)
var
framewin2,win2:IHtmlWindow2;
framedoc:IHtmlDocument2;
frameCol:IHtmlFramesCollection2;
i:Integer;
vi,frame:OleVariant;
begin
win2:=doc.parentWindow;
frameCol:=win2.Frames;
for i:=0 to frameCol.Length-1 do
begin
vi:=i;
frame:=frameCol.Item(vi);
frame.dispVal.QueryInterface(IID_IHTMLWindow2,framewin2);
framedoc:=framewin2.document;
WorkOnFrame(framedoc);
end;
end;
//以上程序,编译出错 Type not allowed in Variant Dispatch call
//请大虾指点,救命呀