Class TIBCArray already exists

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Roaster2
Posts: 51
Joined: Mon 13 Oct 2008 19:29

Class TIBCArray already exists

Post by Roaster2 » Fri 12 Dec 2008 10:36

Hi,

I'm using the latest IBDac in a project which uses a plugin system (from Jedi project).
The main application includes a datamodule which carries TIBCConnection and TIBCQuery (the uses clause includes IBC) and does not uses packages.

This main app loads (via the Jedi plugin system) a package file on startup which also includes a datamodule with many TIBCQueries. Of course the uses clause of the datamodules need IBC, too.

When loading this plugin I get this error: 'A class named TIBCArrayField already exists.' and the loading terminates.

I guess this is due to the fact that the main application and the plugin package include the IBC unit which both try to register this class.

How should I go on to get rid of this error. Can I change the coding in IBC.pas to first check if the class TIBCArrayField has been registered already or can you suggest an alternate solution?

cu,
Michael

Roaster2
Posts: 51
Joined: Mon 13 Oct 2008 19:29

Post by Roaster2 » Fri 12 Dec 2008 10:41

Posted too fast ;-)

I've now added the package ibdac100.bpl (using Turbo Delphi) to the package list of the main application and now this works.

I guess there isn't a better solution to get rid of this class error, correct?

Michael

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 17 Dec 2008 08:39

Probably the initialization section of IBC unit is executed twice. This is a critical error, and IBDAC should not work in this case.

So, I think you should use your solution to avoid the error.

Post Reply