Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6


This question is answered.


Permlink Replies: 8 - Last Post: Oct 13, 2014 1:53 PM Last Post By: Remy Lebeau (Te...
Nicholas Gessler

Posts: 20
Registered: 1/25/98
"ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2014 1:33 PM
We've been using C++Builder since its Borland days in 2000 up to XE6 today. We've taught this to over 500 students in those years and developed over 400 applications which are online at
<https://web.duke.edu/isis/gessler/borland/>
Of course, most of these are fairly basic but they serve to introduce students to C++ through Embarcadero. Consequently, we are heavily invested in applications that have always been migratable to newer versions of C++ Builder. UNTIL NOW.

(I don't remember seeing anything in the advertising for XE6 that said previous versions from RadStudio were not upgradable.)

Consequently, we appeal to those who know how to migrate VCL applications from RadStudio 2010 to XE6 to explain to us how to do it, in newbie detail...

I guessing that, in order to compile to several different platforms, details of the Visual Components had to be changed and this is why RadStudio 2010 VCL projects run into "issues."
Is that true?

From reading previous posts to this forum, people seem to be suggesting several methods.
They are not clear to me, but here are two guesses:

Procedure A, we tried today:
Create from scratch a new VCL application in XE6, "save project as" to a new folder and stop for a moment. Now delete the three Unit.* files in the new folder and replace them with the three Unit.* files from the previous project created under RadStudio 2010. Go back to XE6 and press the green "link, compile and run" arrow.
For an application with one window and 100 lines of code, this worked. We could then modify the code and the visual components successfully.
For an application with two windows and 2000 lines of code, this didn't work. Neither code changes nor visual component changes would "stick."

Procedure B, which I don't want to think about.
Create from scratch a new VCL application in XE6, "save project as" to a new folder and stop for a moment. Go back to the Unit1.cpp file in the RadStudio 2010 project files and copy all the code in Unit1.cpp. Now paste it into the Unit1.cpp file in the XE6. Delete the initial few lines of code that are not duplicated. For each reference to a VCL object in the code, re-create that object anew through the from the Visual Components menu on the right margin. Re-create the appropriate event handlers for those objects (and delete them in the Unit1.cpp file as they are now duplicates, but the appropriate references to them have been made). Continue to reconstruct the entire GUI in this manner.

I hope "Procedure B" is NOT what is recommended. It is a MAJOR task to recreate these components and adjust their properties accordingly.

We are at a major impasse in this course as well as for a planned course in China. We would appreciate any procedures readers of this post might recommend to get over this hurdle.

Sincerely, Nick
Duke University
Information Science and Information Studies
("Disinformation Science and Disinformation Studies")
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2014 2:45 PM   in response to: Nicholas Gessler in response to: Nicholas Gessler
Nicholas wrote:

Consequently, we appeal to those who know how to migrate VCL
applications from RadStudio 2010 to XE6 to explain to us how to do
it, in newbie detail...

It would help to know what issues you are actually having with the migration.

I guessing that, in order to compile to several different platforms,
details of the Visual Components had to be changed and this is why
RadStudio 2010 VCL projects run into "issues." Is that true?

VCL is not multi-platform (unless you count Win32 and Win64 as different
platforms, which I guess they technically are). Only FireMonkey supports
non-Windows platforms. VCL and FireMonkey are very different from each other.
There are third-party tools to help migrate from VCL to FireMonkey, like
Midas. Is that what you are having trouble with? Or are you sticking with
VCL only?

Create from scratch a new VCL application in XE6, "save project as" to
a new folder and stop for a moment. Now delete the three Unit.* files
in the new folder and replace them with the three Unit.* files from
the previous project created under RadStudio 2010.

Why are you doing it that way? Just create the new project, DON'T save its
default units just the project itself, and then add your existing units to
the project.

--
Remy Lebeau (TeamB)
Nicholas Gessler

Posts: 20
Registered: 1/25/98
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2014 3:38 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
It would help to know what issues you are actually having with the migration.

The issues are two-fold for the 2000 line application:
1) Component changes that I make to the Form (Design tab) show while in the IDE but not in the compiled .exe.
2) Code changes that I make in the Unit (Unit1.cpp tab) show while in the IDE but show no evidence of influencing the behavior of the compiled and running .exe.

Or are you sticking with VCL only?
VCL only. I'm just trying to understand what's going on. All our applications are and will be for Windows. We're now running Windows 8.

Create from scratch a new VCL application in XE6, "save project as" to
a new folder and stop for a moment. Now delete the three Unit.* files
in the new folder and replace them with the three Unit.* files from
the previous project created under RadStudio 2010.

Why are you doing it that way?

Not a clue. That was my inadequate understanding of previous discussions...

Just create the new project, DON'T save its
default units just the project itself, and then add your existing units to
the project.

Add them how?
a) By cutting them from the old project folder and pasting them into the new project folder?
b) Or through the IDE?

I'll have to wait until I get back on campus to try this out.
Thank you Remy...
Nick
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2014 5:53 PM   in response to: Nicholas Gessler in response to: Nicholas Gessler
Nicholas wrote:

1) Component changes that I make to the Form (Design tab) show while
in the IDE but not in the compiled .exe.

That implies that the changes are likely being saved in a different DFM file
than the one that is compiled into the EXE.

2) Code changes that I make in the Unit (Unit1.cpp tab) show while in
the IDE but show no evidence of influencing the behavior of the
compiled and running .exe.

That implies that the changes are likely being saved in a different CPP file
than the one that is compiled into the EXE.

Just create the new project, DON'T save its default units just the
project itself, and then add your existing units to the project.
Add them how?

Via the Project Manager.

a) By cutting them from the old project folder and pasting them into
the new project folder?

It is not enough to simply put them in the same folder, the project needs
to have actual references to them.

b) Or through the IDE?

Yes.

--
Remy Lebeau (TeamB)
Nicholas Gessler

Posts: 20
Registered: 1/25/98
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2014 12:33 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy,
Thank you for confirming that diagnosis. My students make those errors when they save to different folders.
In response I tell them never to change the folder they're working with.

They say "the devil is in the details." Sometimes I need someone to take me by the hand and lead me through a procedure.
My students always need that amount of detail...
So after several hours of floundering around I came up with this, which seems to work on four projects that I've tried to migrate upwards:

MIGRATING FROM RADSTUDIO 2010 TO XE6 (for dummies)

BEFORE OPENING EMBARCADERO, GO TO FILE EXPLORER

Create a new folder for the XE6 project.
Go to the old folder containing the RadStudio 2010 project.
Copy all the Unit1 files in the old RadStudio folder and paste them into the new XE6 folder.

OPEN EMBARCADERO

From the top-left main window:
File/New/VCL Forms Application – C++ Builder

From the top-right window “Project1.cbproj – Project Manager”:
Right-Click “Unit1.cpp”
Select “Remove from project”
In the “Confirm” window click “Yes”

From the top-right window “Project1.cbproj – Project Manager”:
Right-click on “Project1.exe”
Select “Add…”
Navigate to the new XE6 project folder.
Select “Unit1.cpp” (which you pasted in earlier).
Repeat if you have more than one Unit.

From the top-left main window:
File/Save Project As
Navigate to the new XE6 project folder.
Save the two (default) Project files.
(The Unit files should already be there.)

To view your Unit(s) and Form(s):
From the top main window:
View/Units (select the “Unit1” file)
Repeat if you have more than one Unit.
If necessary:
View/Forms (select the “Form1” file)

"That's all folks..."
(for now anyway)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 12, 2014 12:54 PM   in response to: Nicholas Gessler in response to: Nicholas Gessler
Nicholas wrote::

From the top-left main window:
File/New/VCL Forms Application - C++ Builder
From the top-right window "Project1.cbproj - Project Manager":
Right-Click "Unit1.cpp"
Select "Remove from project"
In the "Confirm" window click "Yes"

Alternatively, after creating the new project, save it, and you will be prompted
whether you want to save Unit1 or not. Say no, and it will be removed from
the project. This is how I usually do it.

From the top-right window "Project1.cbproj - Project Manager":
Right-click on "Project1.exe"
Select "Add."
Navigate to the new XE6 project folder.

Make sure the project is saved in the XE6 folder first before you start adding
files to it. Until the project is saved, additional files are referenced
in the project using absolute paths (since there is no base folder yet).
Once the project has been saved, additional files are referenced in the
project using relative paths instead. There is no guarantee that existing
absolute paths will get converted into relative paths after saving the project.

--
Remy Lebeau (TeamB)
Nicholas Gessler

Posts: 20
Registered: 1/25/98
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 13, 2014 8:24 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Alternatively, after creating the new project, save it, and you will be prompted
whether you want to save Unit1 or not. Say no, and it will be removed from
the project. This is how I usually do it.

I was not able to do it that way. As soon as I went "Save Project As" the first
option was to save the "Unit1" files. If I said "no" (specifically "Cancel") it would
not give me the option to save the "Project" files. In other words, it wouldn't
let me save the "Project" files without first saving the "Unit" files.

Make sure the project is saved in the XE6 folder first before you start adding
files to it. Until the project is saved, additional files are referenced
in the project using absolute paths (since there is no base folder yet).
Once the project has been saved, additional files are referenced in the
project using relative paths instead. There is no guarantee that existing
absolute paths will get converted into relative paths after saving the project.

I did it in the way I described because I could not save the Project files without
also saving the Unit files. So I added the old "Unit" files from the new folder first
and then "Save As"ed the "Project" to the same folder. I assume that the
absolute paths were converted to relative paths, since from that point on
everything worked as usual. The "Project Manager" showed the absolute
path before I saved the Project to the same folder containing the Unit files.
After I saved the Project to that folder the path appeared to be relative.

Remy Lebeau (TeamB)

Nick
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 13, 2014 1:53 PM   in response to: Nicholas Gessler in response to: Nicholas Gessler
Nicholas wrote:

I was not able to do it that way. As soon as I went "Save Project As"
the first option was to save the "Unit1" files. If I said "no" (specifically
"Cancel") it would not give me the option to save the "Project" files.
In other words, it wouldn't let me save the "Project" files without first
saving the "Unit" files.

Sorry, I missed a step. Create a new project, the CLOSE the default Unit1
without saving it, THEN save the project. The act of closing the default
Unit without saving it will remove it from the project.

I did it in the way I described because I could not save the Project
files without also saving the Unit files.

See above.

So I added the old "Unit" files from the new folder first and then "Save
As"ed the "Project" to the same folder. I assume that the absolute paths
were converted to relative paths

Don't assume. Look in the .bpr/.cproj file and see for sure.

--
Remy Lebeau (TeamB)
Vladimir Ulchenko

Posts: 248
Registered: 1/12/00
Re: "ISSUES" migrating VCL applications from RadStudio 2010 to XE6
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2014 10:57 PM   in response to: Nicholas Gessler in response to: Nicholas Gessler
On Thu, 9 Oct 2014 13:33:27 -0700, Nicholas Gessler <> wrote:

We've been using C++Builder since its Borland days in 2000 up to XE6 today. We've taught this to over 500 students in those years and developed over 400 applications which are online at
<https://web.duke.edu/isis/gessler/borland/>

nice stuff you have there, thanks for sharing the page
unfortunately some links appear to be invalid

--
Vladimir Ulchenko aka vavan
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02