我把代码贴出来各位帮忙看看
function TfrmMain.getSelect(const FormName:String):String;
var
i:OleVariant;
Dispatch:IDispatch;
FrameWindow:IHTMLWindow2;
begin
i:=2;
Dispatch:=(brwDesk.Document as IHTMLDocument2).frames.item(i);
Dispatch.QueryInterface(IHTMLWindow2,FrameWindow);
Result:=(((
FrameWindow.document
as IHTMLDocument2).body.all
as IHTMLElementCollection).item(FormName, 0)
as IHTMLSelectElement).value;
end;
其中brwDesk是TWebBrowser.
不知道哪里错了,一运行到Result这句就报内存错误.