?
Solved

Runtime Package with CLX

Posted on 2003-03-05
9
Medium Priority
?
391 Views
Last Modified: 2010-04-04
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
Comment
Question by:AVAHLDICK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 9

Accepted Solution

by:
mocarts earned 150 total points
ID: 8071664
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
 

Author Comment

by:AVAHLDICK
ID: 8071736
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
 
LVL 9

Expert Comment

by:mocarts
ID: 8071785
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:AVAHLDICK
ID: 8071842
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
 

Author Comment

by:AVAHLDICK
ID: 8072449
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
 
LVL 9

Expert Comment

by:mocarts
ID: 8072556
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
 

Author Comment

by:AVAHLDICK
ID: 8073018
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
 
LVL 9

Expert Comment

by:mocarts
ID: 8074967
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
 

Author Comment

by:AVAHLDICK
ID: 8078935
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question