BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

newby inheritance question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language)
View previous topic :: View next topic  
Author Message
Victor Jetten
Guest





PostPosted: Fri Nov 07, 2003 8:44 am    Post subject: newby inheritance question Reply with quote



hi,
I have an empty TPageControl on a form called EditPageControl. When the user
loads a textfile a TTabsheet is created:

TTabSheet *PCRScript = new TTabSheet(EditPageControl);

then I create a new TSynEdit object linked to the tabsheet:

TSynEdit *Editor = new TSynEdit(PCRScript);
and a label which I ned for certain stuff:
TLabel *FileName = new TLabel(PCRScript);


when the user closes it all I do is:

delete EditPageControl->ActivePage;

Does this delete all the stuff ("children"?) linked to it (sorry I don't
know the correct terms) ?

thanks
Victor Jetten





Back to top
Greg Bryant
Guest





PostPosted: Sat Nov 08, 2003 1:32 pm    Post subject: Re: newby inheritance question Reply with quote



"Victor Jetten" <v.jetten (AT) geog (DOT) uu.nl> wrote in
news:bofm4f$erh$1 (AT) reader10 (DOT) wxs.nl:

Quote:
hi,
I have an empty TPageControl on a form called EditPageControl. When
the user loads a textfile a TTabsheet is created:

TTabSheet *PCRScript = new TTabSheet(EditPageControl);

then I create a new TSynEdit object linked to the tabsheet:

TSynEdit *Editor = new TSynEdit(PCRScript);
and a label which I ned for certain stuff:
TLabel *FileName = new TLabel(PCRScript);


when the user closes it all I do is:

delete EditPageControl->ActivePage;

Does this delete all the stuff ("children"?) linked to it (sorry I
don't know the correct terms) ?

thanks
Victor Jetten

VCL controls are typically pretty good at cleaning up after themselves
(at least the Borland ones seem to be). The problems come with classes
that allocate memory for something, and then don't destroy it in the
destructor. You can try turning on CodeGuard for a little while (don't
forget to turn it back off Smile to see if it catches anything not being
freed properly.

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Language) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.