0

I have a main application in Delphi 7 which loads a Delphi 7 dll (lets call the "X" dll). This dll is an "application core" and a "data base code based framework". This dll holds a lot of stuff. Beyond the main application, I have a lot of others dll which uses the X dll to database access. This is a legacy application.

I have the need to migrate the application to the Delphi 10 Seattle, but I can not do it all at once. It's a very large app.

So I came up with this idea: Convert the main app and create a new database framework, this time in Delphi Seattle BPL, loading statically. When my app starts, I dynamically loads the X dll. In the X dll, I dynamically load the BPL and change all methods that access database to use BPL methods. This way, my others dll that I wont touch right now, will keep working.

The problem is: I can not load the BPL from the X dll. It just raised an AV. I tried use LoadLibrary and LoadPackage, both failed. I found out that if I compile that X dll in Delphi Seattle, it works like a charm. But, I can not do that, because like I said in the begining, this X dll has a lot of stuff beyond the database access, and I do not have the time to convert all right now.

So, the question: How can I load Delphi 10 Seattle BPL from Delphi 7 DLL?

Samuel
  • 259
  • 3
  • 15
  • Why a .bpl and not a .dll? Convert database related functions in X dll to a stub that calls the new dll. What's the problem with that? – Sertac Akyuz Oct 05 '18 at 21:53
  • 7
    You can't load a Seattle BPL from a D7 DLL. Seattle is Unicode based, and its BPL files will not only require Unicode but will require totally different class and RTL library versions. Not going to work at all. I have no idea why you're trying to jump through hoops like this anyway; for the most part, D7 code will compile directly in Seattle, with only changes related to ANSI to Unicode and some unit location changes. I ported a 1M+ LOC from D2007 to XE in about two days. You're going to waste far more time than that trying to get this idea to work. – Ken White Oct 06 '18 at 00:44
  • I want to use BPL because my news app frames will be in BPL as well, so this way they can access the visual FireDac component and I don't need to use only the code based framework. Considering that my new Bpl database framework will use a visual component for connection. – Samuel Oct 06 '18 at 12:33

0 Answers0