JasmineCorp Directory   
  
Usenet News Group Archives!!!

Usenet Groups:

 

 

 

 

 

Re: Create a new form dinamically so that ...
--------------------------------------------------------------------------------------------
Newsgroup: borland.public.cppbuilder.students
Posted by: JD
2006-12-19 17:36:32


kronos wrote:
>
> Is the form i created in this way, a thread or a distinct
> process?

It is just another windowed control that is part of your
application and manager by the application's main thread.
It's no different than a (more complicated) TEdit.

> When i close the "main" form do i have to delete
> the "second" form pointer?

That's up to you. See my other reply as to why. Just keep in
mind that many a hair has been pulled because of double
deletions and using a deleted pointer. It's good practice to
always set the pointer to NULL after a delete because it's
safe to delete a NULL pointer and if you use a NULL pointer,
you'll get an AV at address 00000000 which is *always* and
*only* because you used a NULL pointer which makes tracking
doen the error considerably easier.

> is it correct to use a unique pointer to create indefinitly
> number of new Forms;

Only if you will ever need to have a pointer to a particulare
TForm2 and even then you don't need to maintain a list of the
TForm2's that you've allocated because the VCL does that for
you automatically (see my other reply). If Form2 ever needs
Form1 to do something for it, it can pass a reference of itself
to Form1 so Form1 knows who it's working for.

~ JD

 

 

 

More >> 

Domain Registration:
.com .org .net
.info .biz .us