Ver Mensaje Individual
  #6  
Antiguo 24-01-2008
Kastor Kastor is offline
Registrado
 
Registrado: jun 2007
Posts: 6
Reputación: 0
Kastor Va por buen camino
Thumbs up Solución

gracias a san google pude implementar el Timer de bajo nivel.

Código Delphi [-]
uses
System.Timers

tTimer:System.Timers.Timer;

procedure TimerAction(Sender: TObject; e: System.Timers.ElapsedEventArgs);


constructor TWindowsService.Create;
begin
  inherited Create;

   ttimer:=System.Timers.Timer.Create;
  //la proxima linea soluciono un error que genera .NET
   include(tTimer.Elapsed, TimerAction);

   ttimer.Interval:=300000;//cada 5 minutos
   ttimer.Enabled:=true;

 
end;

procedure TWindowsService.TimerAction(Sender: TObject; e: System.Timers.ElapsedEventArgs);
begin
   //escribir la accion que necesitas, se llamara cada X milisegundos del
   //Timer
    
end;


el error solucionado por Include es:

v.ServerValidate := CustomValidator1_ServerValidate ;


But in .Net world this causes an error:


'read/write not allowed for CLR events. Use Include/Exclude procedure
(E2298)Multicast events cannot be assigned to or read from traditional
Delphi read/write events. Use Include/Exclude to add or remove methods' .

la explicacion y solucion detallada la encuentran en :
http://www.delphi3000.com/printartic...ArticleID=4434



saludos
Responder Con Cita