Advertisement
Advertisement
| 05.14.2008 at 11:32AM PDT, ID: 23402607 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: |
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,unit2;
type
TAt2 = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
end;
TTextA = class(TObject)
t1 : TAt; // <-- from unit2.pas
t2 : TAt2; // <-- locally declared TThread class
constructor create();
destructor destroy();
procedure checkThread();
end;
TForm1 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
constructor TTextA.create();
begin
inherited;
end;
destructor TTextA.destroy();
begin
end;
procedure TTextA.checkThread;
begin
if (t2.terminated) then exit;
if (t1.terminated) then exit;
end;
procedure TAt2.Execute;
begin
{ Place thread code here }
end;
end.
//------------------------------------------------------------------------------
..AND THE SECOND MODULE...
unit Unit2;
interface
uses
Classes;
type
TAt = class(TThread)
private
{ Private declarations }
protected
procedure Execute; override;
public
//property Terminated; <-- uncomment this an compiles OK
end;
implementation
procedure TAt.Execute;
begin
{ Place thread code here }
end;
end.
|