MainFormExchange

Top  Previous  Next

Tools > MainFormExchange

There is a tool called MainFormExchange that assists the creation of C++Builder projects.

 

MainFormExchange

 

 

After you have selected the main form of the Delphi application, the name of the form and the name of the according C++ unit are shown in the fields of MainFormExchange. As in the previous example the main form is called MainForm and the main unit is called main.cpp in the picture.

 

When the button Rename is pressed, the following renaming is carried out:

 

Original name

New name

 

Main.dfm

Main,dfm.001

original Delphi form file

Main.h

Main,h.001

generated from Main.pas

Main.cpp

Main,cpp.001

generated from Main.pas

 

Now the steps 5 to 9 shown at the top of image above have to be executed. As result there now is a new C++Builder VCL Form Application analogously to the original Delphi application. Next the original Delphi form file and the generated C++ files have to be restored, by pressing the button Undo rename. At this step also a backup of the manually created clean C++Builder files is made:

 

Original name

New name


Main.dfm

Main.dfm.000

newly created clean C++Builder form file

Main.h

Main.h.000

newly created clean C++Builder header file

Main.cpp

Main.cpp.000

newly created clean C++Builder source file

Main,dfm.001

Main,dfm

original Delphi form file

Main,h.001

Main,h

generated from Main.pas

Main,cpp.001

Main,cpp

generated from Main.pas

 

The 000-backup files are created in order to be able to make comparisons with the generated files in the case of an error. By pressing the Clear button, they are deleted.

 

If all went well, the basic framework for the C ++ version of the original Delphi application now exists. You have to add the d2c helper files now and the rest of the C++ files, that were generated from the Delphi source files.

 

The Tetris example demonstrates the use of MainFormexchange.

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content