3
votes

I need to install two different component packages, the first one uses BDE connection and the second one uses FireDAC connection, both of them contain a component called "TKsAnalExpr", which is contained in a unit named "UAnalExpr".

I installed one of the package correctly, but when I try to install the second package, Delphi shows this error message:

Registration procedure, [email protected] in package C:\Entorno Delphi XE3\BPL\Kactus.bpl raised exception class EFilerError: Component TKsAnalExpr can't be registered by package kactus.bpl because it has already been registered by package KactusOP.bpl

I changed the name of the units using a namespace, like in for example PkgeBDE.UAnalExpr and PkgeFireD.UAnalExpr respectively.

But when I try to install the second package again, it shows the same error message above.

I'm using XE3 Upd 1 and FireDAC 8.0.5.

PD: In case someone is wondering, "AnalExpr" stands for "Analizador de Expresiones". Heh.

1
Hint: Don't, just don't use "Anal" instead os Analise, Analisis or something like that.oPsDCadarn
You redesign your classes so that TKsAnalExpr has a property called Engine, and when you drop it on a form, you connect the Engine property to the TKsBdeEngine or TKsFireDACEngine. Have you not noticed that for example, there is one TDataSource class, and a multitude of TDatasets that can be connected to the TDataSource? Same idea.Warren P

1 Answers

4
votes

Simply put, you cannot have two registered components with the same name. There is a single namespace for components within a particular framework (VCL or FMX).

Consider how the streaming framework resolves something like this in a .dfm file

object MyComponent1: TMyComponent

It knows that it needs to instantiate an instance of TMyComponent. So it looks up the class with name TMyComponent in that class registry. If it were possible to have two classes with the same name, then that lookup would make no sense.

You have to ensure that the names of registered components are unique.