Ver Mensaje Individual
  #1  
Antiguo 06-09-2016
xangiesaurx xangiesaurx is offline
Miembro
NULL
 
Registrado: feb 2016
Posts: 57
Reputación: 9
xangiesaurx Va por buen camino
Problemas con Threads

Hola a todos, me encuentro en un nuevo dile, estoy migrando un programa que tengo en Delphi 2010 a Delphi XE5, en el cual solo marca 2 errores:

[dcc32 Error] GenericBlockingQueue.pas: E2089 Invalid typecast

El código en donde marca el error es el siguiente:

Código Delphi [-]
procedure TBlockingQueueContentHandler< T >.NotifyDequeue(sender : TObject;
                                                        const item : T;
                                                        action : TCollectionNotification);
begin
  if (action = cnRemoved) and (TObject(item) <> nil) then  <------ Aquí marca el primero
    TObject(item).Free;                                    <------ Aquí marca el segundo 
end;

La declaración del thread se encuentra de la siguiente manera:

Código Delphi [-]
TBlockingQueueContentHandler< T > = class(TThread)
  private
    fBlockingQueue            : TBlockingQueue< T >;
    fOnNewItemInQueueFunction : TOnNewItemInQueueFunction;
  protected
    procedure Execute; override;
    procedure NotifyDequeue(sender : TObject; const item : T; action : TCollectionNotification); virtual;
  public
    constructor Create(blockingQueue : TBlockingQueue< T >;
                       onNewItemInQueueFunction : TOnNewItemInQueueFunction< T >;
                       isObjectDataT : Boolean = false);
    destructor Destroy; override;
  end;

La verdad, no entiendo muy bien los threads y me gustaría saber si podrían ayudarme.
De antemano gracias

Última edición por Casimiro Notevi fecha: 07-09-2016 a las 01:03:21.
Responder Con Cita