|
Title:
|
_Fun with package description strings in D2007
|
Author:
|
Bob Swart |
Posted:
|
2/15/2008 11:36:37 AM
(GMT+1)
|
Content:
|
A client and friend of mine asked my help in solving a problem regarding a Delphi Win32 package which was migrated from Delphi 7 to Delphi 2007 for Win32, but would refuse to remain installed in the IDE. It took me only a short time to figure out why: the package description string he used contained an underscore as first character:
<$DESCRIPTION '_This Package will not be loaded'> As a result, the package would be the first one in the list of installed packages (that's always nice to see), and you could compile and install it, and it would work just fine. During that session of Delphi.
However, if you close and restart the IDE, then Delphi 2007 will notice that the package description starts with an underscore and it will not load the package. The reason is that the IDE uses the underscore character to determine if the package is known and should be installed, or if it's only a "known" package.
The complete list of known packages - installed or not installed - can be seen in the registry at:
HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Known Packages And as a test, you can place underscores in front of descriptions to make sure packages are not loaded (and if you uncheck the checkbox of a package in the IDE's Install Packages dialog, the result is that the description in the registry will get that underscore prefix).
I must admit that I'm not sure if this is documented or not, but I cannot remember having read a warning like "do not give your packages a description that starts with an underscore" before ;-)
This feature was introduced with Delphi 2007 (and CodeGear RAD Studio), so it's something to keep in mind when migrating packages from older versions of Delphi like Delphi 7 or even Delphi 2006 to Delphi 2007 and/or RAD Studio!
|
Back |
|