Runtime Package with CLX

I created a runtime package, with only an unit. This unit uses QForms. Just this !!!!!

Then I create a CLX aplication that load dinamicaly this package. When the aplication try to load, an exception raises.

What is doing here ????

Adilson Vahldcik
AVAHLDICKAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mocartsCommented:
what kind of exception?
if your app uses QForms too (and mostly it does) - you should compile your app and your package with runtime package which includes that QForms (don't know wich exactly, since at the moment I have access to D5 only (maybe vclx70.dcp or vclx60.dcp)) otherwise Delphi will rise an error about duplicated unit.

wbr, mo.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AVAHLDICKAuthor Commented:
EAccessViolation in RTL70.bpl. If I add this package that I created in runtime packages of the application, then it works.

But I want load dinamically, then this isn't necessary to do !?!?!?!?!?!??

I use loadpackage and unloadpackage.

Adilson
0
mocartsCommented:
you can load dynamically, but then you must compile both (exe and bpl) with runtime package vclx70.bpl (which contains QForms).
if you add your custom package to exe's required runtime packages list, then your exe links to your custom package statically and uses QForms from that package.

if you compile with vclx70.bpl runtime package then exe (and your custom package) links to vclx70.bpl. both uses QForms from vclx70.bpl and you can load/unload your custom package at runtime whenever you want.

wbr, mo.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

AVAHLDICKAuthor Commented:
OK. I already added VisualCLX in both.

There is something hide. It doesnt work.

If I delete the uses QFORMS clauses in the unit from de BPL, then runs.

Try to do this that I want. I use D7.

Waiting your answers (and very very thanx for your help)

Adilson

0
AVAHLDICKAuthor Commented:
OK. I already added VisualCLX in both.

There is something hide. It doesnt work.

If I delete the uses QFORMS clauses in the unit from de BPL, then runs.

Try to do this that I want. I use D7.

Waiting your answers (and very very thanx for your help)

Adilson

0
mocartsCommented:
if you receive EAccessViolation error then you must check your loading and calling code (maybe post here)
or,
if you use strings as parameters (or objects that contains strings) to pass to your dynamically loadable package, then you must add to your app and package project uses ShareMem as first unit.

wbr, mo.
0
AVAHLDICKAuthor Commented:
The package has just this unit (contains):

unit UnitofPackage;
interface
uses QForms;
implementation
end.

And requires visualclx.

The project has just a form with a button, and the source is:

procedure TForm1.Button1Click(Sender: TObject);
var
  HDLL : HModule;
begin
  HDLL := loadpackage('Package1.bpl');
  if HDLL > 0 then
  begin
    unloadpackage(HDLL);
  end;
end;

Does a matter if you mark [Build with runtime packages].

All this units and application are CLX.

Try this, please.

If I delete the third line in UnitofPackage, then runs.

Adilson
0
mocartsCommented:
in your exe Project Options under Packages tab you must check Buld with runtime packages, delete all packages except VisualCLX. (both - package and exe must be built with same VisualCLX pacakge)

I tried exactly your code and it works (in Package requires VisualCLX and in exe Project Options - Build with runtime packages - VisualCLX)

wbr, mo.
0
AVAHLDICKAuthor Commented:
YEEEEEEEEEEEEEEEEESSSSS

It works. Very Very Very Very Thanks Friend.

But you can see that isnt so easy, because VisualCLX isn't in the list of runtime packages !!!

Very Thanks again

Adilson
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.