Solved

Upgrading Delphi6 to Delphi7 - rtl60.bpl error

Posted on 2004-08-19
13
3,048 Views
Last Modified: 2012-08-13
Hi,

I am frustrated and tired of trying. I am upgrading code for an application written in Delphi6 to Delphi7. Everything compiles fine and the application runs fine but as soon as it tries to run a package I get an error:

"The application has failed to start because rtl60.bpl was not found. Re-installing the application may fix this problem."

Then it throws an access violation and says unable to load "PACKAGE NAME " package.

The application heavily relies on packages, rather is made up of packages. I have tried following:
1. checked all the  library paths
2. deleted all the dpc and dcu files before rebuilding the delphi6 code in Delphi7.
3. Rebuild all the third party packages (ones I had the source code for)
4. Searched for rtl60.bpl on the hard disk (Didnt find any)

Following piece of code throws the message:

function TForm1.RunDLLForm(aName: ShortString; aControl: TWinControl): Boolean;
var
  aPackageRegItem: TPackageRegItem;
  iFound: Integer;
begin
  Result := False;

  aPackageRegItem  := PackageRegister.Find(aName);
  if not (aPackageRegItem.AccessLevel = lNone) then
  begin
    libHandle := LoadPackage(aPackageRegItem.Filename); //ERROR HERR..
  end;

Please help.

Thanks

Pro2003
0
Comment
Question by:pro2003
[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
13 Comments
 
LVL 3

Expert Comment

by:KyleyHarris
ID: 11848736
You cannot use rtl60.bpl for D7 apps. in the projects options on the packages tab you will have ticked "use runtime packages"
if you are porting an app it is not going to replace rtl60.bpl with rtl70.bpl in your list. you need to change all the used packages yourself
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 11849768
Open your Package and Delete the "Requires" rtl and vcl ... then Build your package again in Delphi 7.

Edu
0
 

Author Comment

by:pro2003
ID: 11852888
Okay, I opened up every single package and removed vcl, rtl from the requires clause. Still no go..
Any ideas. I went through all the projects and opened each one of them as well. I am not sure whats going on.

I am increasing the points for this question to 150.
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!

 
LVL 13

Expert Comment

by:BlackTigerX
ID: 11855552
check in your Delphi menu Project, Options, Packages, in the section "Build with runtime packages" check if you have rtl60 and remove it
0
 

Author Comment

by:pro2003
ID: 11855595
I have already done that. I am not building the packages or the project with the run time packages. I do see rtl and vcl there but its not checked and GRAYED OUT.

and Oh I am using Delphi 7 Professional, could this be a part of the problem

Thanks.


0
 
LVL 3

Expert Comment

by:KyleyHarris
ID: 11856466
Search you path for invalid bpls ie c:\;c:\windows;c:\windows\system32. You may be recompiling with all the best intentions and the application could be attempting to load the wrong one.

how do you name your packages.

I follow delphi style

is MYPac.bpl would be

MyPAC50.bpl
MyPAC60.bpl
MyPAC70.bpl

this way they all reside in system locations happily and do not corrupt different programs that share them. ie if you still have a d5 app relying on it.

hope this helps
0
 

Author Comment

by:pro2003
ID: 11891857
Okay I tried that. I recompiled all the packages and complete project I just have delphi 7 professional installed on my machine. I still get the same error.

Is there a way I can check what rtl is it trying to look for and do some handling there:

May be before the LOADPACKAGE procedure in the code:

function TForm1.RunDLLForm(aName: ShortString; aControl: TWinControl): Boolean;
var
  aPackageRegItem: TPackageRegItem;
  iFound: Integer;
begin
  Result := False;

  aPackageRegItem  := PackageRegister.Find(aName);
  if not (aPackageRegItem.AccessLevel = lNone) then
  begin
    libHandle := LoadPackage(aPackageRegItem.Filename); //ERROR HERR..
  end;

Also is it possible that the units that are not compiled with this project BUT are contained in the  same folder causing this to happen?

Thanks for the input.
PS: I am raising points to 250.
0
 
LVL 3

Expert Comment

by:KyleyHarris
ID: 11897784
I am not certain, but generally the packages that will be looked for are the packages in your list of runtime packages. in Options|Packages| compile with runtime dlls. It will look in the exe location, and then the windows path to find those packages.

In your sample you are calling LoadPackage yourself. This will raise an error if the application has already loaded the package, or if you already have something compiled into your app which also exists in the compiled app. (not counting any normal crashing av's)

This may be hard for anyone to track down for you because of the nature of the problem
0
 

Author Comment

by:pro2003
ID: 11902357
It was the units in the project folder that were not getting compiled and the project code itself that was pointing to rtl60.bpl. I resaved the project and took out all the old units and added only the ones that were required. It worked.

Thanks for all the help.
0
 
LVL 3

Accepted Solution

by:
KyleyHarris earned 250 total points
ID: 11907570
From my first post ;)
>if you are porting an app it is not going to replace rtl60.bpl with rtl70.bpl in your list. you need to change all the used packages yourself

I am glad you finally got it working. I've been there myself.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi inherited method 6 80
Delphi problems to abort a printjob 9 34
Firemonkey BASS_Init into a thread 17 55
Firemonkey Listview item popup menu ? 1 34
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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