I have this procedure in my project
procedure DocumentComplete(ASender: TObject; const pDisp: IDispatch; const URL: OleVariant);
Now I need to use it in a loop by passing the count variable. I tried the following:
procedure DocumentComplete(ASender: TObject; const pDisp: IDispatch; const URL: OleVariant; var contagem : Integer);
But it happens that when I pass the variable, the procedure also requests the other parameters Sender: TObject; const pDisp: IDispatch; const URL: OleVariant
, which between us, I have no idea what they are.
I program by hobby and I'm doing a little project for a friend, please help me. I can not know what to do, I'm sure it's something simple but I searched all day and did not find the solution. What happens in place of these parameters?.
Edit: This is the part where I use the loop to call the procedure, every time it is called it is a different browser used.
procedure TForm1.Button1Click(Sender: TObject);
begin
for contagem := 1 to StrtoInt(Edit1.Text) do
begin
browsers[contagem].OnDocumentComplete := nil;
NavigationOK := true;
browsers[contagem].OnDocumentComplete := DocCompleteA;
browsers[contagem].Navigate
('http://****/index.php?id=entrar');
end;
end;
Creating the browsers:
procedure TForm1.Button2Click(Sender: TObject);
begin
for contagem := 1 to StrToInt(Edit1.Text) do
begin
campos[contagem] := TEdit.Create(self);
campos[contagem].Parent := Form1;
campos[contagem].Show;
campos[contagem].Left := 150;
campos[contagem].Top := 350;
campos[contagem].Width := 600;
browsers[contagem] := TWebBrowser.Create(Form1);
TWinControl(browsers[contagem]).Parent := Form1;
browsers[contagem].Align := alTop;
browsers[contagem].Height := 300;
browsers[contagem].Show;
browsers[contagem].Silent := true;
end;
end;