A ver, que ya no sé por donde mirar y seguro que es una tontería
Quiero saber si un determinado Objecto implementa una determinada interfaz. Es decir, si yo tengo algo como
TLinePoint = class(TCollectionItem) private FOwner: TObject; FMyProp: Integer; procedure SetMyProp(const Value: Integer); protected public constructor Create(Owner: TObject; Collection: TCollection); reintroduce; virtual; destructor Destroy; override; published property MyProp: Integer read FMyProp write SetMyProp; end; ILinePoint = interface ['{35926390-118A-4604-A343-73D200A36006}'] procedure LinePointChanged; end; ..... procedure TLinePoint.SetMyProp(const Value: Integer); var Intf: ILinePoint; begin FMyProp := Value; if FOwner.GetInterface(ILinePoint, Intf) then begin ShowMessage('si'); Intf.LinePointChanged; end else ShowMessage('no'); end;
Es decir, a TLinePoint se le pasa un Owner de tipo TObject en el constructor. Necesito saber si este Owner implementa la interfaz ILinePoint en el Set de la propiedad MyProp, pero no tengo manera de encontrar la forma. ¿Alguna ayudita?
Gracias de antemano