🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.oodesign
Article #22

Re: Delete and null a no modal form

#22
From: Hans Galema
Date: Wed, 23 Jun 2004 19:44
38 lines
2043 bytes
Jose Manuel Tovar wrote:

> I have only one Form2 but I think that if I need more than one I only have
> to define a new global variable where to store the objet, isn't it?

That is possible yes. But your problem after that is to null that pointer
in the form is destroyed.

> 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.

Please trim quotes when replying.

Hans.
Technical Details
Message-ID: <40d9dd53@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40d85f31$1@newsgroups.borland.com> <40d8820d@newsgroups.borland.com> <40d934e5$2@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10db1e,113f95e7fbccde90
X-Google-Attributes: gid10db1e,public
Date: Wed, 23 Jun 2004 21:44:23 +0200
From: Hans Galema <dontusethis@dontusethis.nl>
User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.oodesign
Subject: Re: Delete and null a no modal form
References: <40d85f31$1@newsgroups.borland.com> <40d8820d@newsgroups.borland.com> <40d934e5$2@newsgroups.borland.com>
In-Reply-To: <40d934e5$2@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 129.125.201.248
Message-ID: <40d9dd53@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088019795 129.125.201.248 (23 Jun 2004 12:43:15 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail