4

Very often when I try to open any project in Delphi XE the following issue raises for a few popular bpl-packages:

Can't load package "Name1.bpl". Component "Name2" can't be registered by package "name1.bpl" because it has already been registered by package "name1.bpl". Do you want to attempt to load this package next time a project is loaded?

enter image description here

Thanks a lot for help!

P.S. Kill process and double restart of IDE always helps.

Dmitry
  • 14,306
  • 23
  • 105
  • 189

2 Answers2

6

Make sure the IDE is not loading another copy of SakEmai15.bpl from a different folder.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • I am sure that IDE is not loading another copy. – Dmitry Sep 02 '11 at 20:13
  • 3
    A BPL is just a DLL, and a DLL is reference counted so it can be loaded multiple times from the same path. If the same DLL/BPL is loaded from different paths, they are treated as different instances. Use Process Explorer or File Monitor from SysInternals to verify what the IDE is actually loading. – Remy Lebeau Sep 02 '11 at 21:59
  • 1
    We were not suggesting that you are. The IDE can do unexpected things at times. When troubleshooting IDE issues, you should find out what the IDE is *actually* doing, not what you *think* it is doing. Using a Process/File monitor will tell you exactly which DLl/BPLs are loaded and from what paths. – Remy Lebeau Sep 03 '11 at 20:22
4

New Delphi have feature of delayed package loading. This should optimize startup speed, when packages aren't loaded, when they are not needed.

This works fine for component packages, but spoils a fun for packages which (for example) modifies IDE menu.

You can tell IDE to always load your package by calling ForceDemandLoadState(dlDisable) from Register procedure.

Dmitry
  • 14,306
  • 23
  • 105
  • 189