How to allocate new class instance on the heap?
- From: chrisspencer02@xxxxxxxxx
- Date: 25 May 2005 13:35:41 -0700
According to the documentation I've read, the proper way to dynamically
allocate a new instance of a record TMyRec is:
type TMyRec = record
...
end;
type PMyRec = ^TMyRec;
var
MyRec : PMyRec;
begin
New(MyRec);
// Do stuff with MyRec
Dispose(MyRec);
end;
Should I use the same method for _class_ instances (with constructors
and destructors) as I describe for records above? Or is there another
preferred method?
.
- Follow-Ups:
- Re: How to allocate new class instance on the heap?
- From: Maarten Wiltink
- Re: How to allocate new class instance on the heap?
- From: Bruce Roberts
- Re: How to allocate new class instance on the heap?
- Prev by Date: Using the registry
- Next by Date: Re: How to allocate new class instance on the heap?
- Previous by thread: Using the registry
- Next by thread: Re: How to allocate new class instance on the heap?
- Index(es):