Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I load a BPL dynamically ?

124 views
Skip to first unread message

Dirk Süß

unread,
Nov 3, 1999, 3:00:00 AM11/3/99
to
Hello,

I want to use a self written runtime package (BPL) in a database
application. My problem is how to load it dynamically with the
LoadPackage("PackName.BPL") function.

In an example in Delphi they "used" the files that are contained in the
package. If I include all these files, I don't need to load the package,
because it is linked into the program, if I don't include these files, I'll
get unresolved externals.
I defined the class in the package like this:

class PACKAGE myclass.....


The package is build as runtime only. In my application project / options /
packages the box compile with runtime package isn't checked.

Thanks


Jeff Overcash (TeamB)

unread,
Nov 3, 1999, 3:00:00 AM11/3/99
to

"Dirk Süß" wrote:
>
> Hello,
>
> I want to use a self written runtime package (BPL) in a database
> application. My problem is how to load it dynamically with the
> LoadPackage("PackName.BPL") function.
>

LoadPackage is very simular to LoadLibrary. If you want to do runtime
instantiation of the package then you also need to do runtime retrieval of the
procedure addresses you want to use. Reading further I don't think this is what
you are wanting to do. Using LoadLibrary or LoadPackage is a fairly rare
situation and it doesn't sound like what you are needing to do.

> In an example in Delphi they "used" the files that are contained in the
> package. If I include all these files, I don't need to load the package,
> because it is linked into the program, if I don't include these files, I'll
> get unresolved externals.
> I defined the class in the package like this:
>
> class PACKAGE myclass.....
>
> The package is build as runtime only. In my application project / options /
> packages the box compile with runtime package isn't checked.
>

Check this box and in the edit box only leave those packages you want
dynamically loaded. This will use the import library (bpi) file at compile time
to match up the addresses in the bpl with the calls in your program. Then at
runtime your program will automatically call LoadPackage for you and fixup the
addresses.

> Thanks

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Anyone who cannot cope with mathematics is not fully human.
At best he is a tolerable subhuman who has learned to wear
shoes, bathe and not make messes in the house. (Heinlein)

0 new messages