Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 400
  • Last Modified:

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
0
AVAHLDICK
Asked:
AVAHLDICK
  • 5
  • 4
1 Solution
 
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
 
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now