0
votes

I create some delphi components and they are contained in one bpl-file. Recently I noticed that building bpl (bpl is installed) crashs IDE with exception "MyComponents.bpl_unloaded". But if bpl is not installed this problem doesn't occur. I cant catch this exception and I dont know where it raised (manually I dont call unloadlibrary or others ).

In runtime and disigntime all my components work correctly. The ProjectGroup may contain only my package or projects with/without my components but situation is same. In my project I use other vcl components (uses Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Controls, Vcl.Forms, Vcl.AppEvnts, Vcl.Imaging.Jpeg, Vcl.Graphics). In package file section "requires" contains rtl,vcl,vclimg,VirtualTreesR,Jcl.

How can I correct this problem? thanks in advance

1

1 Answers

4
votes

When a design-time package is installed in the IDE it must be unloaded when you re-build it. It must be unloaded first, then re-built, and then re-loaded.

Clearly the unload stage is resulting in an exception being raised. We cannot say precisely why that exception is being raised, but your next step is to do some debugging. It's actually possible to debug the IDE. You can open a second instance of the IDE and from the first instance attach the debugger to that second IDE instance. You can then unload the package from the second IDE instance and if you've set it all up correctly you should break at the point where the exception is raised.

As an alternative to interactive debugging you might use a tool like madExcept to produce detailed stack traces at the point of the exception. This alone may be enough to lead you to the problem.