Ver Mensaje Individual
  #24  
Antiguo 28-07-2010
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Reputación: 20
richy08 Va por buen camino
claro este es el codigo

Código Delphi [-]
procedure TFrm_Interfaces.ServerConnect(AThread: TIdPeerThread);
var
  NewClient: PClient;
  MisComponentes:tmisComponentes;
begin
   GetMem(NewClient, SizeOf(TClient));
  NewClient.DNS         := AThread.Connection.LocalName;
  NewClient.Connected   := Now;
  NewClient.LastAction  := NewClient.Connected;
  NewClient.Thread      :=AThread;
  AThread.Data:=TObject(NewClient);
  CoInitialize(nil);
  MisComponentes := tmisComponentes.Create;
  MisComponentes.Conexion := TADOConnection.Create(self);
  MisComponentes.Query := TADOQUERY.Create(Self);
  MisComponentes.Conexion1 := TZConnection.Create(self);
  MisComponentes.Query1 := TZquery.Create(Self);
  AThread.Data := @MisComponentes;
  try
    Clients.LockList.Add(NewClient);
  finally
    Clients.UnlockList;
  end;
  Protocol.Lines.Add(TimeToStr(Time)+' The connection to '+NewClient.DNS+' was connected');
end;
Responder Con Cita