Board index » delphi » Repost - "A component name TransmitForm already exists" Error

Repost - "A component name TransmitForm already exists" Error

When the user has a transmition problem and communications
does not terminate properly the transmit form terminates
with an error. Subsequent calles to same form in order to
correct the problem results in receiving the
"A component name TransmitForm already exists" error. The
only way to clear it is to exit the application and start
again.

A user in this group advised me to use the exception block
MyForm := TMyForm.Create(Self);
try
  MyForm.ShowModal;
finally
  MyForm.Free
end;

But I already have it in my code that way. The form is not
third party component. I created it for my application for
the user to enter transmit info (com port, baud rate etc...)

Anybody has any ideas? Thanks

Anita-Maria

 

Re:Repost - "A component name TransmitForm already exists" Error


Anita-Maria,

Here's a snippet showing how I usually create forms at run-time.  Perhaps it
will help.

procedure TMainForm.ReportBtnClick(Sender: TObject);
var
  oFrm: TSummaryReportForm;
begin
  // Show report
  Application.CreateForm( TSummaryReportForm, oFrm );
  try
    oFrm.ShowModal;
  finally
    oFrm.Free;
  end;
end;

It could be that your modal form is not being removed properly from the list
of forms.  How are you closing down the TransmitForm instance?  The
recommended way is to call Close, or set the ModalResult property of the OK
button on the form to mrClose.

Hope this helps

Niels Thomsen

Anita-Maria K. Parolla <point...@erols.com> wrote in message
news:388C7EA2.39C7918D@erols.com...

Quote
> When the user has a transmition problem and communications
> does not terminate properly the transmit form terminates
> with an error. Subsequent calles to same form in order to
> correct the problem results in receiving the
> "A component name TransmitForm already exists" error. The
> only way to clear it is to exit the application and start
> again.

> A user in this group advised me to use the exception block

> MyForm := TMyForm.Create(Self);
> try
>   MyForm.ShowModal;
> finally
>   MyForm.Free
> end;

> But I already have it in my code that way. The form is not
> third party component. I created it for my application for
> the user to enter transmit info (com port, baud rate etc...)

> Anybody has any ideas? Thanks

> Anita-Maria

Re:Repost - "A component name TransmitForm already exists" Error


out of AOnwer....

MyForm := TMyForm.Create(application);
try
   MyForm.ShowModal;
finally
   MyForm.Free
end;

[]'s
humba

"Anita-Maria K. Parolla" <point...@erols.com> escreveu na mensagem news:388C7EA2.39C7918D@erols.com...

Quote
> When the user has a transmition problem and communications
> does not terminate properly the transmit form terminates
> with an error. Subsequent calles to same form in order to
> correct the problem results in receiving the
> "A component name TransmitForm already exists" error. The
> only way to clear it is to exit the application and start
> again.

> A user in this group advised me to use the exception block

> MyForm := TMyForm.Create(Self);
> try
>   MyForm.ShowModal;
> finally
>   MyForm.Free
> end;

> But I already have it in my code that way. The form is not
> third party component. I created it for my application for
> the user to enter transmit info (com port, baud rate etc...)

> Anybody has any ideas? Thanks

> Anita-Maria

Re:Repost - "A component name TransmitForm already exists" Error


When the user has a transmition problem and communications
does not terminate properly the transmit form terminates
with an error. Subsequent calles to same form in order to
correct the problem results in receiving the
"A component name TransmitForm already exists" error. The
only way to clear it is to exit the application and start
again.

A user in this group advised me to use the exception block

MyForm := TMyForm.Create(Self);
try
  MyForm.ShowModal;
finally
  MyForm.Free
end;

But I already have it in my code that way. The form is not
third party component. I created it for my application for
the user to enter transmit info (com port, baud rate etc...)

Anybody has any ideas? Thanks

It is third time that I repost this message. All answers I
get is variation on the exeption block. It does not work and

is not the problem. The problem is that the form crashes and

than when the user tries to call it again he gets the error
"A component name TransmitForm already exists".

Anita-Maria

Re:Repost - "A component name TransmitForm already exists" Error


When the user has a transmition problem and communications
does not terminate properly the transmit form terminates
with an error. Subsequent calles to same form in order to
correct the problem results in receiving the
"A component name TransmitForm already exists" error. The
only way to clear it is to exit the application and start
again.

A user in this group advised me to use the exception block

MyForm := TMyForm.Create(Self);
try
  MyForm.ShowModal;
finally
  MyForm.Free
end;

But I already have it in my code that way. The form is not
third party component. I created it for my application for
the user to enter transmit info (com port, baud rate etc...)

Anybody has any ideas? Thanks

It is third time that I repost this message. All answers I
get is variation on the exeption block. It does not work and
is not the problem. The problem is that the form crashes and
than when the user tries to call it again he gets the error
"A component name TransmitForm already exists".

Anita-Maria

Re:Repost - "A component name TransmitForm already exists" Error


Anita-Maria,

You need to let us have a bit more to work on if you want our help.  You say
that the form "crashes".  What exactly is it that crashes?  The key to
solving your problem is probably to do with proper handling of the "crash"
of the form.

Post a small snippet of code to the forum, or email me directly (remove
no.spam from address) and I'm sure we'll be able to sort your problem out.

Niels

Anita-Maria K. Parolla <point...@erols.com> wrote in message
news:388DC7C0.C1D94DBE@erols.com...

Quote
> When the user has a transmition problem and communications
> does not terminate properly the transmit form terminates
> with an error. Subsequent calles to same form in order to
> correct the problem results in receiving the
> "A component name TransmitForm already exists" error. The
> only way to clear it is to exit the application and start
> again.

> A user in this group advised me to use the exception block

> MyForm := TMyForm.Create(Self);
> try
>   MyForm.ShowModal;
> finally
>   MyForm.Free
> end;

> But I already have it in my code that way. The form is not
> third party component. I created it for my application for
> the user to enter transmit info (com port, baud rate etc...)

> Anybody has any ideas? Thanks

> It is third time that I repost this message. All answers I
> get is variation on the exeption block. It does not work and
> is not the problem. The problem is that the form crashes and
> than when the user tries to call it again he gets the error
> "A component name TransmitForm already exists".

> Anita-Maria

Re:Repost - "A component name TransmitForm already exists" Error


Thanks Niels.

Ok. The form crashes because TAPI fails. When TAPI fail it goes into TAPI
exception block but then it re-enters it. However, after the first time it
enters the TAPI exception it release the resources so the second time it
re-enters it TAPI component was released. As a result the form closes with a
crash. This transmit form has several setting for TAPI that if the user changes
it will not crash so I thought that I let the user go back and change the
setting but the above error would not let them go back. I fought with it long
and hard and eventually, after I could not figure why it reenters the TAPI
exception block second time I created a boolean var that is set to true the
first time it enters the exception block and checks upon entry for it. If the
var is false it goes through the exception if true, exist. So I solved the crash
problem. Now I want to figure out the above error problem. I know that there is
a way to test if the form exist or not by checking if some property is set to
nil but I could not get it to work. I hope it is clear now.

Thanks for all the help

Anita-Maria

Quote
Niels Thomsen wrote:
> Anita-Maria,

> You need to let us have a bit more to work on if you want our help.  You say
> that the form "crashes".  What exactly is it that crashes?  The key to
> solving your problem is probably to do with proper handling of the "crash"
> of the form.

> Post a small snippet of code to the forum, or email me directly (remove
> no.spam from address) and I'm sure we'll be able to sort your problem out.

> Niels

> > It is third time that I repost this message. All answers I
> > get is variation on the exeption block. It does not work and
> > is not the problem. The problem is that the form crashes and
> > than when the user tries to call it again he gets the error
> > "A component name TransmitForm already exists".

Re:Repost - "A component name TransmitForm already exists" Error


Maybe .  You  have these code in the project source code part
  Application.CreateForm( Tmyform, myform);
 delete it  . View the project source code use IDE menu [Project]->[View
Source ] ( Delphi 5 )

Anita-Maria K. Parolla <point...@erols.com> wrote in message
news:388DC7C0.C1D94DBE@erols.com...

Quote
> When the user has a transmition problem and communications
> does not terminate properly the transmit form terminates
> with an error. Subsequent calles to same form in order to
> correct the problem results in receiving the
> "A component name TransmitForm already exists" error. The
> only way to clear it is to exit the application and start
> again.

> A user in this group advised me to use the exception block

> MyForm := TMyForm.Create(Self);
> try
>   MyForm.ShowModal;
> finally
>   MyForm.Free
> end;

> But I already have it in my code that way. The form is not
> third party component. I created it for my application for
> the user to enter transmit info (com port, baud rate etc...)

> Anybody has any ideas? Thanks

> It is third time that I repost this message. All answers I
> get is variation on the exeption block. It does not work and
> is not the problem. The problem is that the form crashes and
> than when the user tries to call it again he gets the error
> "A component name TransmitForm already exists".

> Anita-Maria

Other Threads