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
