> HttpCli[1] := HttpCli2;
You should create the components dynamically, not create an array from dropped
components that may or may not have valid events:
tHttpC: array [1..TotSessions] of THTTPCli;
for I := 1 to TotSessions do
begin
thttpC [I] := ThttpCli.Create (Nil) ;
with thttpC [I] do
begin
Tag := I ;
OnDocBegin := DocBegin ;
OnDocData := DocData ;
OnHeaderBegin := HeaderBegin ;
OnHeaderData := HeaderData ;
OnCommand := Command ;
OnRequestDone := RequestDone ;
OnCookie := CookieRcvdEvent ;
end ;
end ;
> procedure TFM.LanceRequete(n : integer);
And use Sender within all the events to access the current component.
procedure TMainForm.RequestDone (Sender : TObject;
RqType :
THttpRequest; Error : Word);
var
AHttpC: THttpCli;
item, site: integer ;
begin
AHttpC := Sender as THttpCli;
Item := AHttpC.Tag;
xx
end ;
Angus
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be