user382591
user382591

Reputation: 1390

EFilererror exception in Delphi 7

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.

Upvotes: 0

Views: 1473

Answers (2)

tk_
tk_

Reputation: 570

Put {$WEAKPACKAGEUNIT ON} after unit caption.

Upvotes: 1

David Heffernan
David Heffernan

Reputation: 613461

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;

Upvotes: 2

Related Questions