Resource strings

Top  Previous  Next

What is translated > Variables > Resource strings

 

Delphi compiler has built-in support for resource strings whereas in C++ you have to edit resource files manually and insert them into your project. If a project is prepared in that manner the resource strings can be loaded either by the functions LoadStr and FmtLoadStr of the unit Sysutils or by the function LoadResourceString in the System unit. The latter function is used in C++Builder, when it includes Delphi files with resource strings. The first approach of Delphi2Cpp was, to use this method too. But it has proved to be too complicated, because it needs instances of ResourceString structures with a pointers to the module handles of the modules, where the strings are included.

DelphiXE2Cpp11 simply declares resource strings as normal strings:

 

resourcestring

SIndexError  = 'Index out of bounds: %d';

 

then the translated code will be:

 

const System::Char SIndexError[] = L"Index out of bounds: %d";

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content