Jump to content
Alkanium

Migrate an old app in Delphi 2009 to modren C++

Recommended Posts

Hello everyone,

I am a technician in a company who is making business in Healthcare material. A long time ago, an employee programmed softwares for this company with Delphi 2009.
Due to bugs we begin to have, I am in charge to upgrade the apps. But my boss doesn't want Delphi but C++. So I would like to know if I can import the source project into RAD Studio and convert it in C++ to upgrade it.
I also began a new app in Delphi but my boss really wants C++, he thinks that Delphi is not good (because he has a friend who is programmer and said Delphi sucks ... very open-minded programmer, indeed).

So I need your help to convert all stuff I have in Delphi to C++. It's fine if it's not perfect, I know that I will need to adapt many things, I just don't want to begin with a blank project.

I wish you an exellent day and I am waiting for your replies !

Share this post


Link to post
20 hours ago, Alkanium said:

I just don't want to begin with a blank project.

Start with a plan then! Good luck comes from months of careful planning. What about the database, the servers etc. For now, log the bugs to determine if the problem is data entry, codebase, or database design and queries used. Only should then you recompile the hpp files made in Delphi into C++. 

         

Edited by Pat Foley
then added

Share this post


Link to post

I don't know of anything that attempts to automatically translate delphi source code into C++. But Embarcadero RAD Studio C++ can use all the Embarcadero components that Delphi can use so if you use Embarcadero C++ you only have to (manually) translate the Delphi source codes specific to your project(s) into C++. I say "only" - this could still be a significantly complicated task. One bit of advice I always offer someone starting a new s/w project is to answer the question "how am I going to test it?" before you start. ("it" is both the overall project and each individual source code section).

Share this post


Link to post

Do you know Delphi and/or C++? How big is the app?

 

The first thing that should come to mind before considering a rewrite is "Never change a running system".

Edited by uligerhardt

Share this post


Link to post
On 9/23/2023 at 12:11 PM, Alkanium said:

So I need your help to convert all stuff I have in Delphi to C++. It's fine if it's not perfect, I know that I will need to adapt many things, I just don't want to begin with a blank project.

So old bugs will be converted to C++ and new bugs will appear from the conversion itself 🙂

  • Haha 1

Share this post


Link to post

I'm not sure I totally agree here. Yes, if you use an automatic translation then old bugs will be converted to C++. But if you think whilst rewriting AND add unit testing for modules AND refactor if/when there are obvious weaknesses in the existing Delphi code structure then you can end up with a better system. But you need to be aware that it's a big task.

  • Like 1

Share this post


Link to post

In C++ Builder you can import/use Delphi units inside a C++ project, so you don't have to convert everything to C++ to get started. C++ Builder is C++ along with bindings for the Delphi VCL and other units so you will be using a lot of Delphi code under the hood even if all your application code is converted to C++. 

 

Edited by Brian Evans

Share this post


Link to post

What Brian Evans says is true for RAD Studio (where you have both C++ Builder and Delphi). If you only have C++ Builder version you cannot use Delphi units in your project (although it does, as he correctly states) still use Delphi for all the VCL RTL etc.

Share this post


Link to post
2 hours ago, Roger Cigol said:

If you only have C++ Builder version you cannot use Delphi units in your project

You should be able to, as it should have the command-line Delphi compiler available, so that 3rd party components can still be compiled and installed into the IDE for C++Builder to use.

Share this post


Link to post

Hi Remy, I am interpreting "Delphi Units" to mean source code from the original Delphi project that Alkanium has been asked to convert to C++...... As always, what you say is correct.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×