0
votes

I have registered the package TMS Unicode Component Pack in my Delphi 7 containing TNT components. This package contains a class named TTntCustomComboBox which I use to create my own custom component named Combobox2 :

unit Combobox2;

interface

uses
  Windows, Messages, Classes, Graphics, Controls, StdCtrls, ImgList, ActiveX, SysUtils, TntStdCtrls, TntWindows;


type
  TCombobox2 = class(TTntCustomComboBox) 

...
procedure Register;
begin
  RegisterComponents('Standard', [TCombobox2]);
end;

...

I've added this component (TCombobox2) to the package dclusr.dpk. Compiling dclusr.dpk works but installing the package raises an exception :

Registration procedure Combobox2.Register in package C:\program files\Delphi7\Projects\Bpl\dclusr.bpl raised an exception class EFilererror : A class named TTntCustomComboBox already exists

So, how do I fix that ?

Thanks for help.

2
Could you show more code. The entire declaration of TComboBox2, and your Register procedure. - David Heffernan
What are the contents of the 'Combobo2.pas' unit (as opposed to 'Combobox2.pas')? - Sertac Akyuz
Sorry, I 've edited the question. You have to read Combobox2, not Combobo2 - user382591
TCombobox2 = class(TTntCustomComboBox) doesn't compile. What is it really? Is there a semi-colon there? - David Heffernan
Does your package contain a Register procedure for the TNT components? - David Heffernan

2 Answers

2
votes

The error message indicates that your package is trying to register a component that is already registered, namely TTntCustomComboBox.

It's not obvious from the details that you have provided why this would happen. One possible reason would be if you included the TNT components in your package instead of referencing that in your package's requires clause. Another possible reason would be if your Register function attempted to register TTntCustomComboBox. This could happen if your actual declaration of TCombobox2 was like so:

TCombobox2 = TTntCustomComboBox;
0
votes

Put {$WEAKPACKAGEUNIT ON} after unit caption.