Solved

Upgrading Delphi6 to Delphi7 - rtl60.bpl error

Posted on 2004-08-19
13
3,010 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
delphi exception 7 58
Delphi XE10, MySQL Query 4 109
Printing problem 2 72
tidtcpserver connection lost handle 2 47
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now