I'm not sure if this point has been made already, but interface cast (or
querying as defined by COM), only works if the interface has a GUID
assigned. When this is the case, in delphi and I believe in {$mode delphi}
you can cast between object and interfaces like so:

procedure Test(Sender: TObject);
var
  A: IMyInterfaceType;
  B: TMyObjectType;
begin
  if Sender is IMyInterfaceType then
    A := Sender as IMyInterfaceType;
  if A is TMyObjectType then
    B := A as TMyObjectType;
  // other code here
end;
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to