unit UMain;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UKlasse1, UKlasse2, UInterfaces, StdCtrls;
type
TForm1 =
class(TForm)
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
Klasse1: TKlasse1;
Klasse2: TKlasse2;
InterfaceKlasse1: IKlasse1;
InterfaceKlasse2: IKlasse2;
begin
Klasse1 := TKlasse1.Create();
Klasse2 := TKlasse2.Create();
Klasse1.InterfaceZurKlasse2 := Klasse2;
Klasse2.InterfaceZurKlasse1 := Klasse1;
Memo1.Clear();
Memo1.Lines.Add(Klasse1.doSomething());
Memo1.Lines.Add(Klasse2.doSomething());
end;
end.