Solved

Upgrading Delphi6 to Delphi7 - rtl60.bpl error

Posted on 2004-08-19
13
3,034 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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