Article View: borland.public.cppbuilder.oodesign
Article #23Re: Delete and null a no modal form
From: Jose Manuel Tovar
Date: Thu, 24 Jun 2004 14:30
Date: Thu, 24 Jun 2004 14:30
42 lines
2270 bytes
2270 bytes
"Hans Galema" <dontusethis@dontusethis.nl> escribi๏ฟฝ en el mensaje
news:40d9dd53@newsgroups.borland.com...
> Jose Manuel Tovar wrote:
>
> > How can I delete completely Form2 when the Form2 is closed by the user?
I
> > mean that I would like to free the memory used by the form when the user
> > closes Form2.
>
> In general placing the statement
>
> Action = caFree;
>
> in the OnClose() eventhandler of that form.
> But your pointer will not zero then.
>
> >>>void __fastcall TForm2::FormClose(TObject *Sender,
> >>> TCloseAction &Action)
> >>>{
> >>> Action = caFree;
>
> Well you have that already.
>
> >>>__fastcall TForm2::~TForm2()
> >>>{
> >>> Form2 = 0;
> >>
> >>That is ok, provided you keep the caFree;
>
> If you could make an extra parameter for TForm2 that points
> to your pointer than the form can place a null at destruction.
>
I'm afrais that I don't understand what you try to say. Why I need a
parameter that points to TForm2 if I can access to Form2 (the global
variable that points to TFrom2) in the TForm2 destructor and null it?
Could you give me short code example where I can see how to do what you
proposed?
Thaks for your patience.
Technical Details
Message-ID:
<40dae59e@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<40d85f31$1@newsgroups.borland.com> <40d8820d@newsgroups.borland.com> <40d934e5$2@newsgroups.borland.com> <40d9dd53@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10db1e,113f95e7fbccde90 X-Google-Attributes: gid10db1e,public From: "Jose Manuel Tovar" <jtovar@hrs-spiratube.com> Newsgroups: borland.public.cppbuilder.oodesign References: <40d85f31$1@newsgroups.borland.com> <40d8820d@newsgroups.borland.com> <40d934e5$2@newsgroups.borland.com> <40d9dd53@newsgroups.borland.com> Subject: Re: Delete and null a no modal form Date: Thu, 24 Jun 2004 16:30:52 +0200 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 80.33.76.158 Message-ID: <40dae59e@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1088087454 80.33.76.158 (24 Jun 2004 07:30:54 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!atl-c02.usenetserver.com!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail