Saturday, September 02, 2006

Can't register already registered component


Few days ago an avid Delphi programmer posted this image on the Slovenian Delphi forum:

I've been seeing similar errors from Delphi 5 times. This error usually appears when package in question uses some units that are also used by another (already loaded) package and this second package is not listed in the requires section of the first package.

Following steps helped me to solve such mysteries in the past:

  • Uninstall all custom packages.
  • Restart Delphi.
  • Open each custom package, rebuild and install it. During that process, Delphi usually notices the problem mentioned above, warns about it and updates the requires list.

The other approach that may help is a batch file that rebuilds and reinstalls all custom packages. But that is just a workaround if you can't find the real cause of the problem.

BTW, the colleague has found the problematic package but not by following my procedure (he did try it but without success).

BTW2, he is also an author of interesting open-sourced mail read si.Mail.

1 comment:

  1. Anonymous03:08

    D7 has the same problem (can't lod a package because it already has the same package) - it means you are running out of memory, usually because of the DCU cache. Easiest to reproduct when working with multiple large project groups.

    Restart Delphi, because that is the easiest way to clear the cache. Nothing special is needed after that. Just rebuilt the last component project, because you know SOMETHING when seriously wrong.