tw6797b.pp 614 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. program intfbug2;
  2. {$ifdef fpc}
  3. {$mode objfpc} {$H+}
  4. {$endif fpc}
  5. uses
  6. Classes, SysUtils;
  7. type
  8. IMyCom1 = interface
  9. procedure A1;
  10. end;
  11. IMyCom2 = interface
  12. procedure A2;
  13. end;
  14. TMyComCorba = class(TInterfacedObject, IMyCom1, IMyCom2)
  15. procedure A1;
  16. procedure A2;
  17. procedure B;
  18. end;
  19. procedure TMyComCorba.A1;
  20. begin
  21. WriteLN('Com1');
  22. end;
  23. procedure TMyComCorba.A2;
  24. begin
  25. WriteLN('Com2');
  26. end;
  27. procedure TMyComCorba.B;
  28. begin
  29. WriteLN('Corba');
  30. end;
  31. var
  32. I: IUnknown;
  33. A1: IMyCom1;
  34. A2: IMyCom2;
  35. begin
  36. I := TMyComCorba.Create;
  37. if Supports(I, IMyCom1, A1) then A1.A1;
  38. end.