ConsoleDemo

Top  Previous  Next

Installation > Examples > ConsoleDemo

ConsoleDemo example is translated here for Visual C++. The installed folders have following content:

 

 

Folder

Content

ConsoleWorkshop

Delphi source files

ConsoleDemo

Visual Studio C++ project

ConsoleWorkshopWorking

post-processed C++ target files

ConsoleWorkshopGenerated

C++ target files as generated by Aurora2Cpp

 

 

 

The ConsoleGenerated folder marked in gray does not initially exist after installing Aurora2Cpp. It is created automatically when the batch file ConsoleWorkshop.bat is started in the Projects folder.

 

ConsoleWorkshop.bat consists in two lines:

 

"C:\Program Files (x86)\Aurora2Cpp\Aurora2Cpp.exe" -p ConsoleWorkshop.prj -s ..\ConsoleWorkshop\*.pas;*.dpr -t ..\ConsoleWorkshopGenerated

Pause

 

It starts Aurora2Cpp.exe: The ConsoleWorkshop.prj parameter refers to a project file that is also located in the Projects directory.

"..\ConsoleWorkshop\*.pas;*.dpr" specifies the Delphi source files and "..\ConsoleWorkshopGenerated" specifies the folder into which the generated C++ target files are written. The complete list of possible command line parameters can be found here.

 

The ConsoleDemo program makes use of Windows API functions. Aurora2Cpp cannot completely translate this back to C++. Therefore, the automatically generated code must be manually post-processed in order to be able to run it in Visual Studio. The post-processed code is located in the ConsoleWorkshopWorking directory. Due to their parallel location, the two directories can be easily compared. There are some type refactorings defined in ConsoleWorkshop.prj. Without them, the manual post-processing effort would be even greater.

 

Compiling ConsoleDemo also requires parts of System.Sysutils. These must be translated first, and the paths in ConsoleDemo.vcxproj must be adjusted accordingly. RTL/D2C paths are centrally configurable. See

 

    <RtlRoot Condition="'$(RtlRoot)'==''">$(ProjectDir)..\..\..\rtl</RtlRoot>

    <D2CRoot Condition="'$(D2CRoot)'==''">$(ProjectDir)..\..\..\d2c_vc</D2CRoot>

 

in ConsoleDemo.vcxproj.

 

 

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content