Ver Mensaje Individual
  #1  
Antiguo 19-05-2010
Jhonjhon_123 Jhonjhon_123 is offline
Miembro
 
Registrado: may 2010
Posts: 12
Reputación: 0
Jhonjhon_123 Va por buen camino
Question Asociar un procedimiento a un objeto TForm???

Hola!!

miren, tengo este code que lo arme, la idea es cojer un formulario X que tenga el procedimiento "OnRead" y ejecutarlo, pero la cosa es que cuando intendo correr el soft me salta error "Operator not applicable to this operand type" en la linea "//Esta Linea" justo en "OnRead".

Supongo yo que es por que TForm pos no tiene ese prosedimiento, pero no se como arreglarle, quiero enviarle cualquier Form y me lo acepte.

Como lo Resuelvo?

Código Delphi [-]
procedure Sent_DataSocket_Form(CSokcet:TCustomWinSocket; ListView:TListView; ID_Obj:integer; DataSocket:string; ObjForm: TForm);
var
        ID_Item: integer;
        ListItem: TListItem; //Como la X en VB
begin
        ID_Item := GetID_Item_CSocket(CSokcet, ListView);

        if ID_Item >= 0 then
        begin
                ListItem := ListView.Items[ID_Item];
                if ListItem.SubItems.Objects[ID_Obj] <> nil then
                begin
                        (ListItem.SubItems.Objects[ID_Obj] as ObjForm).OnRead(CSokcet, DataSocket); //Esta Linea
                        Exit;
                end;
        end;
end;
Responder Con Cita