Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamically created TFrame

4 views
Skip to first unread message

Roberto Meneghini

unread,
Jan 18, 2006, 1:31:16 PM1/18/06
to
I have created a Frame inside a package. I'm trying to dynamically create
two or more instances of my frame inside a VCL Form. The first one works
fine. The second one raises the following exception "The component named
MyFrame already exists".
This is how I'm creating the Frames:

var
F1, F2 MyFrame.MyGenericFrame;
Begin
F1 := MyFrame.MyGenericFrame.Create(Self);
F1.Parent := Self;

F2 := MyFrame.MyGenericFrame.Create(Self);
F2.Parent := Self;

Any Ideas ?

Thanks,

Roberto


Rudy Velthuis [TeamB]

unread,
Jan 22, 2006, 5:05:17 PM1/22/06
to
At 19:31:16, 18.01.2006, Roberto Meneghini wrote:

> I have created a Frame inside a package. I'm trying to dynamically
> create two or more instances of my frame inside a VCL Form. The first
> one works fine. The second one raises the following exception "The
> component named MyFrame already exists". This is how I'm creating the
> Frames:
>
> var
> F1, F2 MyFrame.MyGenericFrame;
> Begin
> F1 := MyFrame.MyGenericFrame.Create(Self);

F1.Name := 'Frame1';

> F1.Parent := Self;
>
> F2 := MyFrame.MyGenericFrame.Create(Self);

F2.Name := 'Frame2';

> F2.Parent := Self;

As the error already says, you are creating two frames with the same
name. This causes problems with registration.

--
Rudy Velthuis [TeamB] http://rvelthuis.de/

"Descended from the apes? Let us hope that it is not true. But if it
is, let us pray that it may not become generally known."
-- FA Montagu.

0 new messages