Board index » delphi » Packages (VERY IMPORTANT)

Packages (VERY IMPORTANT)

Hi,
I'm creating an application which uses run-time packages.
When i try to fin a class to load in a package, using the "FindClass"
function, I receive this error:

Can't load package [package name]; It contains unit ### which is also
contained in package [package name]

WHAT DOES IT MEAN ?????

Thank you!!

 

Re:Packages (VERY IMPORTANT)


Two packages cannot both contain the same unit. One package needs to
"require" the other package, or they both need to require a third package
containing the unit.

--
Tim Sullivan
Unlimited Intelligence Limited
Dimethylaminoethanol for your software
http://www.uil.net

Quote
"Ezio" <kai...@isiline.it> wrote in message news:3a12b755_2@dnews...
> Hi,
> I'm creating an application which uses run-time packages.
> When i try to fin a class to load in a package, using the "FindClass"
> function, I receive this error:

> Can't load package [package name]; It contains unit ### which is also
> contained in package [package name]

> WHAT DOES IT MEAN ?????

> Thank you!!

Re:Packages (VERY IMPORTANT)


Quote
In article <3a12b755_2@dnews>, Ezio wrote:
> I'm creating an application which uses run-time packages.
> When i try to fin a class to load in a package, using the "FindClass"
> function, I receive this error:

> Can't load package [package name]; It contains unit ### which is also
> contained in package [package name]

> WHAT DOES IT MEAN ?????

Exactly what it says. In a packaged environment you have to put some
thought into how you distribute your units since each unit can only
appear in *one* package at a time. You can think of a process with a
bunch of loaded packages as if it where one single application with all
units compiled into one executable. Like you cannot include the same
unit twice into a Delphi project you cannot include it in two packages
in such a project. The solution is to move the common units into
another package which is then put into the "requires" list of all
packages needing the units. This common package is usually loaded
statically from the application, by placing it into the apps package
list.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Other Threads