Re: A solution for Nilling Child form pointers
From: Martin James (mjames_falcon_at_dial.pipex.com)
Date: 10/26/03
- Next message: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Previous message: Lauchlan M: "Re: OO Database"
- In reply to: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Next in thread: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Reply: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 26 Oct 2003 01:18:03 +0100
..or maybee something like: (just a suggesiton - may not work in MDI
framework?)
type
pTformRef=^Tform;
TautoDestructForm=class(TForm)
private
pRef:TformRef;
public
constructor create(anOwner:TComponent;pFormRef::pTformRef);
destructor destroy; override;
end;
TautoDestructForm.create(pFormRef::pTformRef);
begin
pRef:=pFormRef;
inherited create(anOwner);
pRef^:=self;
end;
TautoDestructForm.destroy;
begin
pRef^:=nil;
inherited;
end;
..
..
myForm:TautoDestructForm;
..
..
TautoDestructForm.create(self,@myForm);
Using the constructor/destructor gives you a form to derive from that
auto-destroys its reference & frees up the tag/onDestroy events.
Rgds,
Martin
- Next message: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Previous message: Lauchlan M: "Re: OO Database"
- In reply to: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Next in thread: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Reply: Kristofer Skaug: "Re: A solution for Nilling Child form pointers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|