Autor Beitrag
phoque
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 01.11.05 10:54 
Ist es irgendwie moeglich von einer Unit1 auf Unit2 zugreifen zu koennen, und gleichzeitig den Zugriff von Unit2 auf Unit1 zu ermoeglichen.
Wenn ich in Unit1 die zeite Unit bekannt mache, und umgekehrt in Unit2 die erste bekannt mache, dann geht das nicht. Da kommt dann eine Fehlermeldung 'circular references ...'.
Wie kann ich das irgendwie umgehen?

phoque
Stefan.Buchholtz
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 612

WIN 2000, WIN XP, Mac OS X
D7 Enterprise, XCode, Eclipse, Ruby On Rails
BeitragVerfasst: Di 01.11.05 11:12 
Es geht, wenn du eine der Units nur im implementation-teil einbindest, also so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
unit Unit1;

interface

uses
  Unit2;

...

implementation

...

end.


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
unit Unit2;

interface

...

implementation

uses
  Unit1;

...

end.


Die bessere Lösung ist aber meiner Meinung nach, eine dritte Unit zu erstellen, die alles beinhaltet, was von beiden Units benötigt wird und die in beiden einzubinden.

Stefan
phoque Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Di 01.11.05 14:06 
danke, das funktioniert