| View previous topic :: View next topic |
| Author |
Message |
Sergio Sette Guest
|
Posted: Wed Mar 28, 2007 4:15 am Post subject: Very strange package loading problem |
|
|
I've installed a design-time package without problems (D2006).
But when i start delphi the package (listed in the design-time packages)
is not loaded (initializazion and register procedure are not executed).
When i drop a component belonging to this package then both
initialization section and Register procedure are called.
Any idea ?
Best regards
sergio sette |
|
| Back to top |
|
 |
Sergio Sette Guest
|
Posted: Wed Mar 28, 2007 5:04 am Post subject: Re: Very strange package loading problem |
|
|
Sergio Sette wrote:
| Quote: | But when i start delphi the package (listed in the design-time packages)
is not loaded (initializazion and register procedure are not executed).
|
But the package is marked as loaded inside the IDE. |
|
| Back to top |
|
 |
Sergio Sette Guest
|
Posted: Wed Mar 28, 2007 5:24 am Post subject: Re: Very strange package loading problem |
|
|
I've investigated a little bit more into the problem and i've found
trying to reinstall the package the installation fails (unable to load
package) but restarting th IDE after this causes the package to be
loaded correctly. Restarting the IDE again without any changes causes
the package to not be loaded at startup (is always listed as a loaded
package).
I'm doing something wrongs ?
Best regards |
|
| Back to top |
|
 |
TOndrej Guest
|
Posted: Wed Mar 28, 2007 8:12 am Post subject: Re: Very strange package loading problem |
|
|
Sergio Sette wrote:
| Quote: | I've investigated a little bit more into the problem and i've found
trying to reinstall the package the installation fails (unable to load
package) but restarting th IDE after this causes the package to be
loaded correctly. Restarting the IDE again without any changes causes
the package to not be loaded at startup (is always listed as a loaded
package).
I'm doing something wrongs ?
|
I'd guess that the IDE is loading an older version of the .bpl, not the one
that results from recompiling the .dpk from source.
My advice is to check your paths.
HTH
TOndrej |
|
| Back to top |
|
 |
Robert Marquardt Guest
|
Posted: Wed Mar 28, 2007 2:09 pm Post subject: Re: Very strange package loading problem |
|
|
Sergio Sette wrote:
| Quote: | I've installed a design-time package without problems (D2006).
But when i start delphi the package (listed in the design-time packages)
is not loaded (initializazion and register procedure are not executed).
When i drop a component belonging to this package then both
initialization section and Register procedure are called.
Any idea ?
|
Make your finalization section clean, i. e. set global variables to
uninitialized as last step (assign nil to freed objects etc). That was a
problem with the JVCL until we cleaned all the finalization sections. |
|
| Back to top |
|
 |
Sergio Sette Guest
|
Posted: Thu Mar 29, 2007 1:13 am Post subject: Re: Very strange package loading problem |
|
|
TOndrej wrote:
| Quote: |
I'd guess that the IDE is loading an older version of the .bpl, not the one
that results from recompiling the .dpk from source.
My advice is to check your paths.
|
I've checked my HD and there are not copies of my package.
I think the problem has something to do with package dependencies. My
package, A_DT, is a design-time package that depends to other packages
(A, P and P_DT, where A is the run-time A_DT related package and P_DT is
another installed design-time only package).
The P_DT package works correctly, and recompiling P or P_DT the first
package get recompiled and loaded.
Best regards
sergio sette |
|
| Back to top |
|
 |
Sergio Sette Guest
|
Posted: Thu Mar 29, 2007 1:20 am Post subject: Re: Very strange package loading problem |
|
|
Robert Marquardt wrote:
| Quote: |
Make your finalization section clean, i. e. set global variables to
uninitialized as last step (assign nil to freed objects etc). That was a
problem with the JVCL until we cleaned all the finalization sections.
|
Tnx for the tip. I have cleared (commented!!) all my initialization and
finalization code, but the problem persists.
I think the problem is with dependencies (my package depends from anoter
installed package and recompiling the last one my package get loaded)
but is very difficult for me understand why the ide reports the package
as loaded where isn't. And more difficult is for me explain why the
package get loaded after dropping a package's component onto a
form/datamodule.
Sergio Sette |
|
| Back to top |
|
 |
Erik Berry Guest
|
Posted: Thu Mar 29, 2007 2:21 pm Post subject: Re: Very strange package loading problem |
|
|
Sergio Sette wrote:
| Quote: | I've installed a design-time package without problems (D2006).
But when i start delphi the package (listed in the design-time packages)
is not loaded (initializazion and register procedure are not executed).
When i drop a component belonging to this package then both
initialization section and Register procedure are called.
|
The IDE delay loads (demand loads) packages/bpls when it believes that the
code is not needed immediately in memory at the time the IDE is loading. In
general, this is a good thing, but if you don't like it for whatever reason,
call ForceDemandLoadState(dlDisable).
Erik |
|
| Back to top |
|
 |
Sergio Sette Guest
|
Posted: Thu Mar 29, 2007 4:38 pm Post subject: Re: Very strange package loading problem |
|
|
Erik Berry wrote:
| Quote: | The IDE delay loads (demand loads) packages/bpls when it believes that
the code is not needed immediately in memory at the time the IDE is
loading.
|
Aha !! Is this new in D2006 ?
In general, this is a good thing, but if you don't like it for
| Quote: | whatever reason, call ForceDemandLoadState(dlDisable).
|
Tnx a lot Eric. Very useful tip, this solve my problem !!
Sergio sette |
|
| Back to top |
|
 |
Dmitry Gritsay Guest
|
Posted: Fri Apr 06, 2007 1:56 pm Post subject: Re: Very strange package loading problem |
|
|
Hello Erik,
| Quote: | The IDE delay loads (demand loads) packages/bpls when it believes that the
code is not needed immediately in memory at the time the IDE is loading.
In general, this is a good thing, but if you don't like it for whatever
reason, call ForceDemandLoadState(dlDisable).
|
How can I make IDE loading a package programmatically from another
unrelated package?
I need to get access to all installed components in IDE from my
wizard. Using PaletteAPI
I get a component list, but I cannot get reference to each class
(via FindClass) because
not all packages are loaded in the IDE.
Best regards,
Dmitry Gritsay |
|
| Back to top |
|
 |
Erik Berry Guest
|
Posted: Tue Apr 10, 2007 3:05 am Post subject: Re: Very strange package loading problem |
|
|
Dmitry Gritsay wrote:
| Quote: | How can I make IDE loading a package programmatically from another
unrelated package?
|
Try LoadPackage/UnloadPackage. Depending on what you need, you may also
need to manually lookup the address of and call the Register/IDERegister
procedures.
Erik |
|
| Back to top |
|
 |
|