Solved

Upgrading Delphi6 to Delphi7 - rtl60.bpl error

Posted on 2004-08-19
13
3,036 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
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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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