Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Migrate Delphi XE4 to Delphi 10 Seattle



Permlink Replies: 6 - Last Post: Jun 30, 2016 6:22 AM Last Post By: Victor Zanella Threads: [ Previous | Next ]
Victor Zanella

Posts: 9
Registered: 2/21/16
Migrate Delphi XE4 to Delphi 10 Seattle
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 26, 2016 5:48 AM
Hi, i'm migrating our project to Delphi 10.
But i got a problem.

Actually our project have BDE, but isn't used.
So i decide to remove it.
But, we use fatreport, and fastreport seems to use BDE.

So what could i do now ?

Is it ellegant use BDE only for fastreport ?
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Migrate Delphi XE4 to Delphi 10 Seattle
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 26, 2016 6:16 AM   in response to: Victor Zanella in response to: Victor Zanella
Victor Zanella wrote:
Hi, i'm migrating our project to Delphi 10.
But i got a problem.
You only got "known issues"
Actually our project have BDE, but isn't used.
So i decide to remove it.
Good.
But, we use fatreport, and fastreport seems to use BDE.
Not only. You can use other datasets as well.
Is it ellegant use BDE only for fastreport ?
No it isn't but you don't have to. It seems FastReports can manage other datasets also.
If you have reports already created using BDE dataset I would convert them to use another dataset.

https://www.fast-report.com/public_download/html/FR5UserManual-HTML-en/index.html?tfrxdbdataset_component.htm
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: Migrate Delphi XE4 to Delphi 10 Seattle
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 26, 2016 6:34 AM   in response to: Robert Triest in response to: Robert Triest
Thaks for all.

I'll try this.

:D

---

So, i guess i didn't express myself as well.

the unit frx2xto30.pas has frxBDEComponents in uses list.

the unit frxBDEComponents.pas has DBTables in uses list.

At my 'Delphi XE4 Enterprise', DBTables is in ../bin/source/Data/BDE

And it works well.

But at 'Delphi 10 Seattle Pro', i don't want to install BDE

this is the problem.

maybe the problem is migrate from an Enterprise version to a Pro, or maybe there are another version of fastreport for non BDE users.

---

The same occurs to IBX

Edited by: Victor Zanella on Apr 26, 2016 7:18 AM
Robert Triest

Posts: 687
Registered: 3/24/05
Re: Migrate Delphi XE4 to Delphi 10 Seattle
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2016 12:46 PM   in response to: Victor Zanella in response to: Victor Zanella
the unit frx2xto30.pas has frxBDEComponents in uses list.

My feeling is that frx2xto30.pas is a helper unit for compatibility when fastreport went from version 2 to 3.
Maybe you can just remove the declaration from the Uses in your source. I assume your current
reports are written with BDE components, so when you don't want to use the BDE anymore you
have to change your reports and replace the BDE components with other database
access components like ADO, DBExpress or FireDac. The BDE is not shipped with Delphi anymore
but offered as a separate download.

http://cc.embarcadero.com/item/30359

Also the BDE components you have to register/install after installing Delphi

http://support.embarcadero.com/article/44082

maybe the problem is migrate from an Enterprise version to a Pro,
I don't think so but the Enterprise version includes FireDac, a component
set build as a BDE replacement. The Pro version still contains the ADO
and DBExpress components.

or maybe there are another version of fastreport for non BDE users.
No, there is no BDE version of FastReport. FastReport only supports building reports
based on databases using BDE components.

I would install the BDE and the components in your Delphi and try to migrate your
entire application and be sure that you can run your reports.
When it works well you change the BDE components to another database set by replacing
the TTable, TQuery, etc to a set like TADOTable, TADOQuery or TSQLTable, TSQLQuery.

p.s.

You already use XE4, so you can also change your reports in this version of Delphi
before you move to Seattle. Make a copy of the project and change the current reports
so that they don't use the BDE components anymore.

Edited by: Robert Triest on Apr 27, 2016 9:50 PM
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: Migrate Delphi XE4 to Delphi 10 Seattle
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2016 1:01 PM   in response to: Victor Zanella in response to: Victor Zanella
Hi again.

Thanks for help me, I solved the problem with FastReport.

But now i got another problem.

I have something like this:

TObjectList<T> as parameter to a TObject
TObject casting to TObjectList
TValue := TObjectList[i]


for better understanding: https://drive.google.com/file/d/0B-qtxzE9Z884SlNONDlQOVFnRFU/view?usp=sharing

In Delphi XE4 it works, but as Delphi 10 Seattle i got an Access Violation.

Why it happens ?

I can solve this problem, just casting the List as <T>. but i cant cast easily because it's a generic type.
Another solution that i gess will work, is change that TObjectList from Contnrs to Generics, but it will makes me do a large refactoring.

So can anybody show me another solution ?

Edited by: Victor Zanella on Jun 29, 2016 1:02 PM
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Migrate Delphi XE4 to Delphi 10 Seattle [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2016 1:48 PM   in response to: Victor Zanella in response to: Victor Zanella
Victor wrote:


The TClasseAuxiliar.List member is a non-generic System.Contnrs.TObjectList,
whereas the TListaPessoa type is an alias for System.Generics.Collections.TObjectList<T>
instead.

When calling TesteObjectList(), you are passing in a TObjectList<T> and casting
it to a TObjectList. That will never work correctly.

In Delphi XE4 it works

Not safely, though. It "works" in XE4 because TObjectList and TObjectList<T>
have similar (but not exact) memory layouts. In particular, their respective
object arrays are at the same relative offset in memory.

but as Delphi 10 Seattle i got an Access Violation.

TObjectList and TObjectList<T> in Seattle have different memory layouts.
In particular, their respective object arrays are NOT at the same relative
offset in memory. TObjectList<T> has an extra data member before its object
array. TObjectList does not have that.

Why it happens ?

Because you are relying on undefined behavior that was never safe from the
beginning.

TObjectList and TObjectList<T> are two completely different and unrelated
classes, in all Delphi versions. They are not compatible with each other,
and you cannot type-cast one to the other, in any Delphi version.

Another solution that i gess will work, is change that TObjectList
from Contnrs to Generics, but it will makes me do a large refactoring.

It is the correct solution, though, if you intend the TClassAuxiliar.List
member to point at an external TObjectList<T> list instead of copying the
objects into its own local list.

Otherwise, either don't use TObjectList<T> at all, or else make TClassAuxiliar
itself have a Generic <T> parameter so the user can specify the type to use
for the TObjectList<T> member.

--
Remy Lebeau (TeamB)
Victor Zanella

Posts: 9
Registered: 2/21/16
Re: Migrate Delphi XE4 to Delphi 10 Seattle [Edit]
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 30, 2016 6:22 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thanks, it's all i have to know.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02