ConsoleDemo

Top  Previous  Next

Installation > Examples > ConsoleDemo

ConsoleDemo example is a small program by Rudy Velthuis:

 

http://rvelthuis.de/programs/console.html

 

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

 

 

Folder

Content

Console

Delphi source files

ConsoleDemo

Visual Studio C++ project

ConsoleWorking

post-processed C++ target files

ConsoleGenerated

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 Console.bat is started in the Projects folder.

 

Console.bat consists in two lines:

 

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

Pause

 

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

"..\Console\*.pas;*.dpr" specifies the Delphi source files and "..\ConsoleGenerated" 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 Console program makes extensive 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 ConsoleWorking directory. Due to their parallel location, the two directories can be easily compared. There are some type refactorings defined in Console.prj. Without them, the manual post-processing effort would be even greater.

 

 

The code for the ConsoleDemo assumes that the translated RTL code is in the SourceWorking directory. If it is somewhere else, ConsoleDemo.vcxproj must be adjusted accordingly.



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content