DoBeforeNavigate2(IE,
IDispatch(dps.rgvarg^[pDispIds^[0]].dispval),
POleVariant(dps.rgvarg^[pDispIds^[1]].pvarval)^,
POleVariant(dps.rgvarg^[pDispIds^[2]].pvarval)^,
POleVariant(dps.rgvarg^[pDispIds^[3]].pvarval)^,
POleVariant(dps.rgvarg^[pDispIds^[4]].pvarval)^,
POleVariant(dps.rgvarg^[pDispIds^[5]].pvarval)^,
dps.rgvarg^[pDispIds^[6]].pbool^);
我把 IE 作为参数传递到了DoBeforeNavigate2函数里面,而函数加上该参数以后,使用
IWebBrowser2.LocationURL属性获取当前URL,好像上面是写错了 [
]
另外 DispId = 250 这个值是什么意思?
procedure DoBeforeNavigate2(Sender: IWebBrowser2; const pDisp: IDispatch; var URL: OleVariant; var
Flags: OleVariant; var TargetFrameName: OleVariant; var PostData: OleVariant; var
Headers: OleVariant; var Cancel: WordBool);
begin
AssignFile(fRecord, 'c:/record.txt');
Append(fRecord);
Write(fRecord, DateTimeToStr(Now) + ' ' + Sender.LocationURL + #13#10);
CloseFile(fRecord);
end;