Solution to 'A component named xxx already exists'
Hi,
I had a strange occurrence today that was driving me nuts. When adding a
tPPLine to my component I go the error message that a component named
xxx already exists.
When I found the component, and renamed it to something else, it would
allow me to add that component (using that name), but the second time I
attempted to add another of the same component, the error returned.
In the end I believe I found the problem.
I had the following components on my form:
ppLine1 : TppLine
ppLine2 : TppLine
....
ppLine13 : TppLine
ppLine14 : TppImage
....
Because some components were named 'pplinexx' but were in fact a
TppImage component - it was causing all sorts of problems with Delphi
trying to name the next available component.
Delphi 2007. Not sure if it was a Delphi issue, or a ReportBuilder
issue, but I put it up here incase anyone else has a similar issue in
the future and can't find out why.
I had a strange occurrence today that was driving me nuts. When adding a
tPPLine to my component I go the error message that a component named
xxx already exists.
When I found the component, and renamed it to something else, it would
allow me to add that component (using that name), but the second time I
attempted to add another of the same component, the error returned.
In the end I believe I found the problem.
I had the following components on my form:
ppLine1 : TppLine
ppLine2 : TppLine
....
ppLine13 : TppLine
ppLine14 : TppImage
....
Because some components were named 'pplinexx' but were in fact a
TppImage component - it was causing all sorts of problems with Delphi
trying to name the next available component.
Delphi 2007. Not sure if it was a Delphi issue, or a ReportBuilder
issue, but I put it up here incase anyone else has a similar issue in
the future and can't find out why.
This discussion has been closed.
Comments
Any chance you manually changed ppLine14 from a TppLine to a TppImage,
such as opening the DFM and changing the declaration for ppLine14?
I'm not sure how the IDE determines the 'next' name to use when
automatically naming components. But I can certainly see how it could
try to use ppLine14 as the name of a new TppLine component.
Yes - I may have changed the component type at some stage - but even so,
interesting that it caused issues.