Board index » cppbuilder » Migrate from C++Builder to Delphi?

Migrate from C++Builder to Delphi?


2003-09-22 08:41:37 AM
cppbuilder88
As a user of C++Builder since release 1, I am very concerned with the
possibility that this product will no longer be updated by Borland.
Although this may be premature, I wonder how I will continue to expand
and support an application that was developed under C++Builder5. I
have never used Delphi and I don't have a copy of it, but it seems as
if migrating to Delphi is one possible solution. This approach would
allow me to use the third party VCL add-ons that I already own. I have
not used the STL in my application.
C++Builder allows the use of .pas units. Can a C++Builder application
be converted to Object Pascal one form at a time? Each form's .dfm
file should still work, and the .h and .cpp files for each form could
be converted to a .pas file. I was able to add a .pas form to my
C++Builder project, but it was added by the IDE as a unit and not as a
form. And the Borland C++Builder help says, "When adding a .PAS file
to your project, you can not edit or modify the file." (Topic "Using
.pas files in C++Builder projects".)
I am interested in knowing if anyone has converted a C++Builder app to
Delphi and how they went about doing it. If this approach has some
merit, and if it is made necessary by the decisions that Borland is
making on their product line, I think that Borland should be helping
developers make this migration. This might include selling Delphi8 to
C++Builder users for the upgrade price; producing a white paper on how
to do the migration; a conversion utility; and a new user group for
this topic.
If I had my wish, I would upgrade to C++Builder8 with VCL.NET support.
Or, if the new CBuilderX product supported a form designer and the
VCL, I would use it. But if neither of these are viable options, I
want to start immediately to do what I have to do to salvage what I
can from my existing code.
Regards,
Jon Gabel
 
 

Re:Migrate from C++Builder to Delphi?

"Jon Gabel" < XXXX@XXXXX.COM >wrote in message
Quote
As a user of C++Builder since release 1, I am very concerned
with the possibility that this product will no longer be updated
by Borland.
It is supported. It is merely undergoing a new design.
Quote
I wonder how I will continue to expand and support an
application that was developed under C++Builder5.
By continuing to use BCB5 as you already are. Just because a new product is
out does not mean that you cannot continue using the current projects. For
example, my own company is still using BCB3 for legacy support of one of our
projects.
Quote
This approach would allow me to use the third party VCL
add-ons that I already own.
If you continue to use BCB5, then you can continue to use the components you
have.
Quote
C++Builder allows the use of .pas units. Can a C++Builder
application be converted to Object Pascal one form at a time?
Only if you are willing to translate every single line of your C++ code to
Pascal.
Quote
Each form's .dfm file should still work
Yes. DFM is not tied to any particular language.
Quote
and the .h and .cpp files for each form could be converted to
a .pas file.
Yes, but it would be tedious to do so, depending on just how much code you
actually have. Also keep in mind that C++ and Pascal are very different
languages, they play by different rules, so not everything may be a direct
translation.
Quote
I was able to add a .pas form to my C++Builder project
That is because BCB includes a Pascal compiler. Delphi does not include a
C++ compiler.
Quote
And the Borland C++Builder help says, "When adding a .PAS
file to your project, you can not edit or modify the file." (Topic
"Using .pas files in C++Builder projects".)
Not true. .Pas units themselves are still text-based source files like any
other. You can edit them just fine in BCB's editor, and BCB's editor even
has syntax-highlighting support for Pascal code. What you can't edit are
DFM forms belonging to Pascal code. BCB does not support editor Pascal
forms.
Quote
If I had my wish, I would upgrade to C++Builder8 with VCL.NET support.
There is no BCB8.
Quote
Or, if the new CBuilderX product supported a form designer
and the VCL, I would use it.
In case you missed the announcement earlier this week, Borland will be
releasing official statements within the next couple of weeks regarding VCL
support (amongst other thingS). I suggest you wait until then before making
any uninformed decisions.
Gambit
 

Re:Migrate from C++Builder to Delphi?

Hi.... this is mi story ... sorry for my english.....
I wrote a big application in OWL in 1996 ..... for the future of BC5 and
for the marketing of Borland I migrate to C++Builder 1..... A hard work,
because the new library (VCL) and the limitation of multiple
inheritance...... Total time to migration: 8 months...
I upgrade frecuenty for versions of C++Builder for correct vcl bugs and
compiler issues.... But in 2001 - 2002 the project was unmanageable, in
particular for:
- Bugy compilation: The sources generates programs with diferent behavior,
especialy with make....(crazy float precition, wrong class initialization,
ghost functionality of delete code, etc)
- Build time: to reduce the "crazy funcionality" I have to build all modules
(bpls and exes) in the project.... about 20 minutes for build. :( ...
- Bugy Debuger: The debuger has not funcionality in aprox 4 function calls
of deep in some circunstances, the workaround is reduce the deep of function
calls for test code...
In this year I discover a whole of web sites for delphi components
(specially www.torry.net) and discover delphi code..... I start to use
delphi code in my application, noticing that: compiled very instantaneously.
I migrate C++Builder Application to Delphi, in about 4 mounts.....its most
stable, and the compiler time is "instantaneous"..
Migration Facilites:
- Equal api of VCL.
- Text find - replace of ({,},::,->,int,...) with ( begin, end, .,.,
integer, ...)
- Equal dfm structure: Copy paste procedure :)
Migration Problems
- No templates: All my templates rewrite to TList ,
- Struct: In my case I have struct with constructors and member functions.
To solve this I wrote global functions. Note: In delphi 8 record is equal to
classes.
- return: retur = result := x; exit;
- No overload operators.
- String: operators: Use generic funcions to convert integer to stirng ,
etc....
- Var definition: The most hand work of migration. Move the definition of
var tho the var block of the function of procedure.
- Constructor and Destructor: Delphi has a funny behavior in constructor an
destructor because not implicity call inherited constructor/destructor ( 90%
of the bugs in migration).
"Jon Gabel" < XXXX@XXXXX.COM >wrote in message
Quote
As a user of C++Builder since release 1, I am very concerned with the
possibility that this product will no longer be updated by Borland.
Although this may be premature, I wonder how I will continue to expand
and support an application that was developed under C++Builder5. I
have never used Delphi and I don't have a copy of it, but it seems as
if migrating to Delphi is one possible solution. This approach would
allow me to use the third party VCL add-ons that I already own. I have
not used the STL in my application.

C++Builder allows the use of .pas units. Can a C++Builder application
be converted to Object Pascal one form at a time? Each form's .dfm
file should still work, and the .h and .cpp files for each form could
be converted to a .pas file. I was able to add a .pas form to my
C++Builder project, but it was added by the IDE as a unit and not as a
form. And the Borland C++Builder help says, "When adding a .PAS file
to your project, you can not edit or modify the file." (Topic "Using
.pas files in C++Builder projects".)

I am interested in knowing if anyone has converted a C++Builder app to
Delphi and how they went about doing it. If this approach has some
merit, and if it is made necessary by the decisions that Borland is
making on their product line, I think that Borland should be helping
developers make this migration. This might include selling Delphi8 to
C++Builder users for the upgrade price; producing a white paper on how
to do the migration; a conversion utility; and a new user group for
this topic.

If I had my wish, I would upgrade to C++Builder8 with VCL.NET support.
Or, if the new CBuilderX product supported a form designer and the
VCL, I would use it. But if neither of these are viable options, I
want to start immediately to do what I have to do to salvage what I
can from my existing code.

Regards,

Jon Gabel

 

{smallsort}