> > Question - is the new component automatically freed when the form is
> > destroyed?
> >
> > I've normally kept a list of components created on the fly and
> specifically
> > freed them - maybe I don't need to.
> >
> > Stephen
> >
> That's why I like to create the component with owner of self (ie the form).
> When the form is destroyed the component will automatically be destroyed. Of
> course it always depends what you are doing. Chrissy mentioned she had
> problems using .Create(self) but that is probably being caused by code
> elsewhere - the concept works.

My problem was that the Create method wanted to TTreeView and Self was a 
form.   There was no other code other than the standard Delphi stuff for a form
with one button and the unit that had the my class in it.  The only code in this
unit was a Create method the called the inherited method.  I do not think that
the other code was causing the problem but what fixed it was using "nil".

Chrissy.

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to