Delphi2Cpp Changelog

What's new in Delphi2Cpp 1.6.3

Feb 2, 2012
  • Member variables are initialized in the initialization lists of the constructors with default values automatically now, if there aren't any explicit initializations in the body of the constructor. If there are such explicit initializations, then they are moved into the initialization list. This shift doesn't take place if the initialization depends on a condition.
  • The macros "DECLARE_DYNAMIC" and "IMPLEMENT_DYNAMIC" can be renamed by means of the substitution table of the translator now. An obvious alternative would be to use the macros "DECLARE_DYNCREATE" and "IMPLEMENT_DYNCREATE" also defined in the Microsoft Foundation Classes (MFC).
  • The calculation of the list of the constructors of the base classes, which can be accessed also in the derived class, was improved. Previously also equally named overwritten constructors were added to the list. From now on, this only happens if the extended RTTI abilities are enabled, to use the TD2CObjects or the DECLARE_DYNAMIC and IMPLEMENT_DYNAMIC marcros. Both need the basic standard constructors.
  • The names of originally used constructors are inserted as comments into the translated code now, if the "Verbose" option is enabled and the name is not "Create". This makes it easy to make manually corrections, if there are differently named Delphi constructors with the same signature.
  • The adaptation at the passing of variables to Windows API functions was improved. If a function is declared as EXTERNALSYM, the translator uses it only when there isn't any alternative declaration. An example of first case would be "PeekMessage" and an example of second case would be "PtInRect". All files of the folder "CodeGear\RAD Studio\6.0\source\Win32\rtl\win" are interpreted as C-like now.

New in Delphi2Cpp 1.6.2 (Feb 2, 2012)

  • There is a simplified treatment of resource strings in Delphi2Cpp now. In C++, the use of resource strings isn't as simple as in Delphi. In C++, at first resource files with string lists must be created from where the strings then can be loaded at runtime. Delphi2Cpp offers a workaround solution now which usually makes translated programs run also without resource file and which can be enlarged by real resource files in a simple way.
  • Parameter lists are found out correctly for nested functions now if forward declarations are needed there.
  • The support for UnicodeStrings was improved. UnicodeStrings are treated correctly in the source code now although Delphi2Cpp is restricted to the language standard of Delphi 7 essentially. In addition the distinction between WideString and UnicodeString in the options, which had had been formal only till now, now it has real consequences for the translation, e.g. the "c_bstr" method isn't called for UnicodeStrings any more.
  • Reference variables for structures which are inserted temporarily as results of with expressions are modified by "consts" now if there is a reading access to them only. So, occasional error messages of the compiler are avoided, that an L value of the corresponding type is required.
  • Since for C++Builder types of base classes, properties and field with "published" visibility may not be qualified by namespaces in according cases using clauses are written now at the beginning of the header files.
  • For this update large quantities of Delphi source code has been translated. Many further detail improvements are derived from these experiments.

New in Delphi2Cpp 1.6.0 (Feb 2, 2012)

  • The user interface is based on unicode now so that special characters in comments of foreign languages in UTF8 encoded Delphi files are shown correctly now. Further other flaws of the user interface were removed. E.g. you can search on the log page expressions in the log tree now too. At the translation from files Delphi2Cpp doesn't push itself to the foreground any more so that other work can be done in addition on the same computer.
  • There also are some other small improvements: when copying comments, no mixed line endings from single "line feed" characters and combinations with it and the "carriage return" character can result any more. Comments after variable declarations aren't inserted before the initialization any more and more.

New in Delphi2Cpp 1.5.2 (Feb 2, 2012)

  • The result of the breakup of nested functions was optimized. All parameters, variables and constants were passed from the primary function to the subordinate functions till now. This is only carried out for the quantities actually required from Delphi2Cpp 1.5.2 on. It is taken into account that at multiple nesting possible parameters which aren't needed in a function itself but in a function subordinated to it are passed through. The "result" variable for the return value of the topmost function is submitted to subordinate functions under the name "xResult" and therefore is distinguished from the "result" variables there.
  • Files beginning with an UTF8 Byte Order Mark (BOM) are converted to ANSI now, before they are processed. (All files are saved as ANSI files.)

New in Delphi2Cpp 1.5.1 (Sep 27, 2011)

  • At the translation of "for"-loops the number of lopps is calculated only once now before the beginning of the first run.
  • The bug in the commandline mode was fixed, that the overwritten System.pas was not found.
  • There isn't a plus operator to add a wchar_t to a WideString. Such additions are made by means of a string now, which are created temporarily from the character.
  • With the key word "absolute" a variable can be declared in Delphi that resides at the same address as an existing variable. This behavior is reproduced in C++ now by declaring the new variable as a reference to the existing variable. If necessary according typecast's are inserted.
  • The real example "ATBinHex" was translated with Delphi2Cpp 1.5.1 now. The number of required manual corrections is reduced further.

New in Delphi2Cpp 1.5.0 (Aug 22, 2011)

  • Delphi2Cpp includes an almost complete translation of the system unit and the Sysutils unit of Delphi to C++ now. Particularly the Sysem unit is basically in Delphi, because it is included implicitly in all other units. It balks at an automatic translation because many intrinsic functions belong to it, which are installed directly into the Delphi compiler and aren't definded in "System.pas" at all or only cryptically. The unit Sysutils is also basic since it is included by most of other Delphi units. While the C++ Builder is partly providing the functionality of these two units in a C++ adaption of the Delphi RTL/VCL, the prefabricated C++ translations make the translation of the Delphi code of one's own easier for other compilers enormously. Also for C++ Builder the parts of the System unit are completed now, which are missing in the Delphi RTL/VCL adaption of the manufacturer of C++ Builder.
  • In the course of the systematization accompanied with the translation of the whole System unit the existing files "d2c_file.h/.cpp" were renamed to "d2c_sysfile.h/.cpp".
  • There is a C++ counterpart for "array of const" parameters for other compilers than the C++ Builder now. With C++Builder a macro is used to initialize an OpenArray class with the elements of the "array of const" and which constructs a second parameter for the number of elements at the same time. There is a similar OpenArray class, now for other compilers, which is based on a std::vector. Since this class has the size method an additional parameter isn't necessary.
  • A character c cannot be converted directly into a standard string in Visual C++. This is required for example at an assignment of a chain of strings to the string S:S= c + S. Therefore the conversion is made by the constructor "basic_string (size_type n, chartT c, ...)" now, that is: S = String(1, c) + S. This works for the standard strings of all compilers.
  • At the comparisons of standard strings with a character the latter is converted into a string in the way just mentioned. E.g. "if S == c then" becomes: if " (S == string (1, c)) ".
  • Delphi set's are translated now as Daniel Flower's TSet automatically for other compilers than the C++ Builder, instead of using "System::Set". TSet is defined in the file DelphiSets.h.
  • At the execution of Delphi2Cpp in the command line mode the error messages and warnings which are produced at the processing of single files are output now, too.
  • The treatment of namespaces was changed slightly: if an extended "System.pas" is set, the namespace for it is "d2c_system" per default, notwithstanding of the actual file name. This expression can be changed in an additional field of the options dialog now. If no extended "System.pas" is set, the system namespace is "System" per default and it can be changed in the same way.
  • Also the table of the substitutions of the translator can be used now, to change the namespace for a file. So it is possible, to create the same namespace for the contents of different files.
  • The namespace option is no longer mandatorily required for the use of an overwritten "System.pas" for the C++ Builder. Notwithstanding whether this option is activated or not, the namespacs - normally: d2c_system - is preceeded to the type "file", to the distinct it from the definition as void* in the Borland "System.pas".
  • The fault was eliminated, that the address operator was executed again if in Delphi the address of a variable is passed to a function and the variable as a var parameter is already an address in C++.
  • This update was made in cooperation with a customer who has written a case study about his project. Many thanks to Tony.

New in Delphi2Cpp 1.4.9 (Jun 21, 2011)

  • The type names "Char" and "PChar" aren't translated according to the options for the string translation into "char" and "char*" or into "wchar_t" and "wchar_t*" any more, but "Char" is left non-translated and "PChar" is translated to "Char*". The name "String" also isn't changed at the translation. So the generated C++ code can be switched from Ansi strings to Wide strings more easily with the help of corresponding definitions of "Char" as "typedef char Char;" or "typedef wchar_t Char;" and corresponding definition of "String".
  • If the option "string as WideString" is selected, "Char" and "PChar" are translated correspondingly as "wchar_t" and "wchar_t* now, analogously to Delphi2009.
  • High( X ) and Low( X ) are translated now by template functions High< X >() or Low< X >(), if X is a type identifier. These functions are evaluated at compile time already and they are portable. Registrated users find the definitions of "High" and "Low" in "d2c_system.pas".
  • The function "Pos" isn't translated by "find" for standard strings any more. A "Pos" function must be called also in C++ instead. Mostly with "find" and addition of the value 1 to the result the same results could be achieved as with "Pos", but in the case that no sub-string is found, with string::npos a type is returned, which doesn't yield the value -1 on all systems in the comparison with integers.
  • The SmallString class was extended and is based now on a character array, which is terninated with null.
  • The signature of functions, which expect a string by value, isn't changed any more. Before, Delphi2Cpp had changed the code to pass a constant reference of the string instead. This is more efficient in C++, since it avoids copying the character array, but a manual post-processing of the code was necessary, if the string is changed within the function body.
  • The bug was fixed that generated C++Builder project files for console applications got the extension "bpk" instead of "bpr".
  • Announcement: the next update will deliver a C++ translation of the files "System.pas" and "Sysutils.pas". The prize for Delphi2Cpp will be raised considerably again with the version 1.5.0.

New in Delphi2Cpp 1.4.8 (Jun 1, 2011)

  • Delphi method pointers which make the event treatment by delegation possible are reproduced also for other compilers than the C++ Builder now. There is the language expansion for it in the C++ Builder with the "__closure" keyword.
  • There is a SmallString class for Visual C++ and other compilers now.
  • The Delphi directives $HPPEMIT, $EXTERNALVAR, $NODEFINE and $NOINCLUDE are supported now completely. This make the translation of the VCL possible.
  • The unification of the case-notations of identifiers is expanded on the contents of comments now. So, the symbols are assigned correctly in the directives mentioned above. This expansion can have effects on pretranslated C++ code. The identifiers used there have to be be included in the substitution list from now on.
  • Constants aren't treated any more as variables to be declared externally.
  • The bug was fixed, that the identifiers of namespaces were missing for the first parameters in nested functions and for base classes of objects.

New in Delphi2Cpp 1.4.7 (Jun 1, 2011)

  • Complete Delphi projects can be converted to C++Builder projects now with Delphi2Cpp at once, provided that the Delphi dpr-file is in the root folder of unambiguously named source files of the project. In detail:
  • 1. the files belonging to the project are looked up recursively in the subdirectories
  • 2. the according paths are taken into the project options
  • 3. the files are translated
  • 4. a Delphi2Cpp management is produced
  • 5. a C++-Builder project file is created (second, third and 4th point only with the professional edition).
  • You can see this new feature in a video, which presents the conversion of a Delphi project of the game "Tetris" to C
  • The paths for the files not to be translated (VCL) and the paths for the files to be translated are set separately in the project options now.
  • Selected project options can be marked now as default options which are loaded automatically at the restart.
  • The routines Read(Ln)/Write(Ln), which accept an arbitrary number of parameters in Delphi are taken to pieces by Delphi2Cpp now. In each call of these functions only one I/O parameter is passed.
  • The special formatting instructions for Write(Ln) and Str procedures marked by colons, are reproduced with usual parameters separated by commas in the separated calls now.
  • For the reproduction of the Delphi I/O routines which don't can be transferred to C++ analogously, there is prefabricated C++ code now. It defines: TTextRec, typed and untyped TFileRec and the functions: IOResult, FileSize, Flush, AssignFile, Seek, SeekEof, SeekEoLn, Erase, Rename, Eof, EoLn, SetTextBuf, Truncate, Close, CloseFile, Rewrite, Reset, BlockWrite, BlockRead, Write, WriteLn, Read und ReadLn.
  • Missing return values and parameters of routines in the implementation part are completed by the values from the corresponding declarations now automatically.
  • Records with methods are accepted and translated by Delphi2Cpp now. This is a first step beyond Delphi 7.

New in Delphi2Cpp 1.4.5 (Apr 13, 2011)

  • The Meta capabilities of Delphi which are partly reproduced by the C++ expansions of the C++ Builder, which however are not available for other compilers, can be simulated now with a TObject class, which was developed especially for Delphi2Cpp. class methods, such as "ClassName" and "InheritsFrom", are available with that. There is even the possibility of producing objects of the respectively required type now with a virtual "Create" method. Also for the C++ Builder there is this possibility now: Delphi2Cpp can provide that a class which originally is derived from TObject of the C++ Builder VCL, is derived from a class TD2CObjekt in the translated code instead. TD2CObjekt has this "Create" method. (The TObject/TD2CObject classe are delivered with the professional version of Delphi2Cpp only.)
  • class methods were translated as simple static methods till now. In C++ no counterpart of Delphi's "Self" exists then. From now on class methods get an additional parameter, which is a pointer to the type of the calling object and functions as "Self" with that.
  • Virtual class methods also can be translated now. Though static methods of C++ cannot be virtual, the additional parameters allows the redirection to a virtual method, which is inserted by Delphi2Cpp now in addition to the static method.
  • The "is" operator is translated now like: Obj->ClassNameIs( targetClass->ClassName() ), if a VCL class is tested for a Meta-class.
  • The integration of the overwritten "System.pas" was improved. At a definition like "THandle = System.THandle" the type is looked up in the own sytem file now at first.
  • Comparisons of a string with the empty string are replaced in the translation by the method calls "IsEmpty" or "empty" now. The efficiency is increased for std::strings and for VCL strings ambiguities are avoided.
  • The translation of abstract methods was changed. Because objects with abstract methods can be created in Delphi, but not in C++, these methods aren't translated as abstract in C++ any mor, but such, that they throw a exceptions, if called.
  • Because this update is very essential, a version jump from 1.4.3 to 1.4.5 is justified.

New in Delphi2Cpp 1.4.1 (Feb 5, 2011)

  • There is a workaround now for returning static arrays from functions. Because this is not possible in C++, a pointer to the first element of the array is returned and used as argument for "memcpy". In cases, where the static array is locally constructed inside of a function, a helping array in the file scope is used for an intermediate copy of the array.
  • With-statement are translated in another manner now. Instead of inserting the with-expression at all according positions, a temporary variable of the resulting type is created now. So constructions like the following are translated correctly too:
  • with TmyObject.Create do
  • try
  • // do something with the object
  • finally
  • Free;
  • end;
  • >
  • /*# with TmyObject.Create do */
  • TmyObject* tmp2 = new TmyObject;
  • try
  • // do something with the object
  • __finally
  • tmp2->Free();
  • The hardly understandable error message "unit expected" appeared, if an included file began with an UTF8 BOM. This BOM is created from recent Delphi versions and is accepted from Delphi2Cpp now too.
  • There is now a simplifying macro for the dynamic_cast in place of the "is" operator:
  • define ObjectIs(xObj, xIs) dynamic_cast< xIs >( xObj )
  • This macro must be contained in the overwritten System.pas. If this file is not used also the marco is not used, the translation remains the same as in the previous versions of Delphi2Cpp.
  • Instead of the not existing "BDE.pas" "bde.int" is analyzed now, if the path of this file belongs to the include paths. If the files "WinTypes.pas" and "WinProc.pas" are not found, the preprocessor replaces their references with the reference to "Windows.pas".
  • More special bug fixes.

New in Delphi2Cpp 1.4.0 (Feb 5, 2011)

  • The professional version of Delphi2Cpp.exe can be executed as command line programm too now.
  • The source code file "System.pas" - particularly important to Delphi - can individually be overwritten and/or extended now (only in the professional version of Delphi2Cpp).
  • The skeleton of such an individual "System.pas" is installed into the "source" folder. The most important functions for the memory management are defined in this "d2c_system.pas". The translation of the file with Delphi2Cpp yields working C++ code and can be compiled and linked together with the translated files of one's own.
  • "d2c_system.pas" contains among others also special functions for "Inc" and "Dec" which work also for enumerated types. For such types these functions aren't replaced by the incrementing or decrementing operators at the translation any more.
  • The function "Fillchar" will not be converted to the "memset" function automatically any longer. In a more systematic way the function was inserted in "d2c_system.pas" instead.
  • Temporary parameters in function calls are put in front of these calls explicitly as variables now. This variable and the function call are enclosed into a {...} block. So the life time of the variables is guaranteed for the time period of the function call. It is ensured at the same time that the two instructions are within a common block even if the original instruction had been an isolated part of a control structure without such block. E.g.:
  • if Greet(PChar('hello ' + Name + '!')) then
  • Exit;
  • >
  • AnsiString Str__0( "hello " ) + Name + "!";
  • if ( Greet( Str__0.c_str( ) ) )
  • return;;
  • If a temporary "set" of values is passed as "open array" parameter to a function, a corresponding array is produced in C++ output now, which is put in front of the function call.
  • procedure Log(strings : array of String);
  • Log(['one', 'two', 'three']);
  • >
  • void __fastcall Log( const String* strings, int strings_maxidx )
  • String tmp__0[ 3 ];
  • tmp__0[ 0 ] = "one";
  • tmp__0[ 1 ] = "two";
  • tmp__0[ 2 ] = "three";
  • Log( tmp__0, 3 );
  • Improvements in the calculation of compile time constants.
  • The strategy, to leave identifiers of type identifiers unchanged has been exceeded. E.g. "String" isn't replaced by "AnsiString" or "WideString" any more.
  • Till now, "String" parameters were always treated like Delphi strings, also if the option for the translation as standard strings was activated. From this update on, "String" parameters are treated in conformity with "AnsiString" and "WideString".
  • Missing namespace identifier at constants and in redeclared constructors are written now.
  • The case sensitivity of sections of code where "Cpp" is defined isn't corrected any more. Before, e.g. it could happen that "# include " was changed to "#Include ".
  • Substitutions are already executed now before a used unit is opened so that instead of the original unit another one can be included. The special substitution of "WinProc" to "Windows" already was done automatically, if "WinProc" wasn't found. This happens for "WinTypes" now automatically, too.
  • "MSWINDOWS" per default is defined now. This definition can be removed or replaced of course.
  • The quality of the translation was checked once more by a: in May 2010 the real example "ATBinHex" was translated with Delphi2Cpp 1.3.0 for the first time. Now the example was translated again with Delphi2Cpp 1.4.0. The number of required manual corrections is reduced to less than the half.
  • The help to Delphi2Cpp optionally can be installed also as a PDF file.
  • There is now a Translation service with Delphi2Cpp.

New in Delphi2Cpp 1.3.9 (Feb 5, 2011)

  • "ShortString" and "String[n]" are translated adequately now as far as possible. I.e. calls of "Length", "SetLength", "Low" and "High" are treated for these string types especially. For other string methods "ShortString" and "String[n]" are converted into a strings temporarily. (ShortString were treated like normal strings till now.)
  • The methods for the calculation of pointer types were revised completely. This often leads to more precise translation results than till now. This concerns particularly dynamic arrays. Till now, parameter type frequently became replaced by base types. This still happens in few wanted cases, such as the substitution of "PChar" by "char*".
  • The definition of constants by other constants is completely made in C++ now by substitution of the values of the constants already defined so that the compiler don't complains any more.
  • The namespace feature was completed: the names of namespaces of base classes are inserted and forward declarations are written into the namespace now.
  • Faults with global variables in the interface part were eliminated.

New in Delphi2Cpp 1.3.8 (Nov 11, 2010)

  • In the professional version there is a new option now, to create a namespace for each unit. In C++ header files the namespaces are put in front of types from other units and in the C++ implementation files according using clauses are inserted. Identifiers, which are qualified by namespace's are resolved accordingly.
  • The Delphi directives $HPPEMIT, $EXTERNALVAR, &NODEFINE and $NOINCLUDE are supported by Delphi2Cpp now.
  • With the update 1.3.6. a bug was built into the dialog for the list of the include paths. At multiple use of the dialog the list was copied repeatedly. This fault was fixed.
  • More error information is already shown to in the file manager during the processing of the files now.
  • If in a case statement a set of more than 1000 elements is defined for a "case", these cases are listed no longer completely at the translation. A note is written instead: "There are too much cases! This section of code has to be converted by hand!". Delphi2Cpp needed much time till now, to write such lists, so that it seemed as if the program stood still.
  • Bug fix in the preprozessor: "UNDEF" didn't work for identifiers, which were not already set as defined in the options of Delphi2Cpp. The directives "$I+" and $I-" are ignored now.

New in Delphi2Cpp 1.3.7 (Oct 25, 2010)

  • Many improvements of details in the implementation part of units which are often hard to describe. Some important points are:
  • Previously only the priority of the "and" and "or" operators over the equality operators were considered. The order in which other operators are executed within expressions in Delphi is now reproduced in the translated C++ code too.
  • "not" is converted to '~' now if the type of the following expression is not a boolean.
  • The bug was fixed, that functions for the initialization of arrays were not called, if there is no intitialization part in the unit.
  • Many other improvements with typecasts, pointers, nested functions etc..

New in Delphi2Cpp 1.3.6 (Oct 6, 2010)

  • There is an additional dialog for user settings now. There you can set, whether screen positions shall be restored at the restart of Delphi2Cpp.
  • "System.pas" will always be parsed in addition to the other included files. This procedure provides much more signatures of functions and class and record definitions as before, where only parts of this file were simulated. If "system.pas" cannot be found the program works as before.
  • If an instance identifier for the form associated with a unit is specified in a program file, like in "Demo in 'Demo.pas' {DemoForm}", this is translated now in accordance with the CBuilder convention as "USEFORM("Demo.cpp", DemoForm);".
  • In dependence from the compiler directive "$APPTYPE" the "main" function of a program file is translated as a "WinMain" function for GUI applications and a "main" function for console applications now.
  • Members at the beginning of a class declaration that don’t have a specified visibility for are made by default "__published" for CBuilder and "public" for other compilers now, if the class is derived from "TPersistent".
  • Variables of simple types get initialized now.
  • The higher priority of "and" and "or" operators over the equality operators in Delphi is guaranteed in C++ by according parenthesis now.
  • A string S isn't passed to parameters of the type "var x" and "x : pointer" as "S.c_str()", but as "&S".
  • At a division with '/' the numerator is casted to a double, if it isn't already.
  • The bug was fixed, that accidental value were set for constants with negative values.
  • The bug was fixed, that an exception block "catch (...) {}" was added at the translation of "try/except on E do handle_exeption".
  • Other small bug fixes.

New in Delphi2Cpp 1.3.5 (Sep 14, 2010)

  • With the professional version of the Delphi2Cpp of this update it is possibly at first to preprocess all source files and then to optimize the translation of the preprocessed sources without need to preprocess the code every time once more.
  • The options for other compilers were extended so that from now on also special code variants can be produced for Visual C++ and gcc.
  • A bug at the translation of "program" "library" and "package" files was fixed.
  • Interface types are treated as pointers now.
  • The "file" type and the "text" type are translated as "void*" now.
  • The oreder of declarations has been reworked.
  • Bugs with variable names in nested functions were fixed.
  • Many other small bug fixes.

New in Delphi2Cpp 1.3.3 (Sep 14, 2010)

  • When a source code was translated a second time, it could happen that types wern't translated correctly any more. Instead the verbose output produced "/*# waiting for definiens ...". Now types defined in other interfaces than of the current source remain marked as defined, so the error will not appear again.
  • PChar, PAnsiChar and PWideChar are converted into the pointers on the corresponding character types now.
  • If the type y is an array, the type of x in "var x : ^y;" is now evaluated as a pointer to an element of y. Otherwise the code is translated as "y* x;"
  • The support for std::string and std::vector was improved for the case that the special treatment of VCL functions is enabled. In addition, the index is corrected now at the access of single characters of the 0 based standard strings.
  • For other compilers as the CBuilder the access to default properties is carried out in the C++ code via the generated access methods just, as in the case of other properties now.
  • Comments after the final dot at the end of a unit aren't ignored any more
  • The missing linebreak is inserted now in cases like: TFormXXX* FormXXX;#pragma resource "*.dfm"
  • There is now a video, which demonstrates how Delphi2Cpp uses typeinformations internally:

New in Delphi2Cpp 1.3.2 (Sep 14, 2010)

  • Small included units triggered a user abort. This bug was fixed.
  • A line comment without a following line break at the end of a file caused an error. This bug was fixed.
  • The choice not to include any precompiled header can be saved in the options file now.
  • The resulting type of the "assigned" function is bool now too, if the option for the special translation from VCL functions turned off. Therefore "and" or "or" translates to "&&" or "||" between calls of "assigned".
  • With C-Like option on "TRec = record ... end;" is now translated to "typedef struct {...} TRec;" instead of "struct TRec {...};" for C++.

New in Delphi2Cpp 1.3.1 (Jul 7, 2010)

  • Read properties are translated for other compilers than CBuilder by const functions only if member variables are returned and not for the call of functions any more.
  • Delphi2Cpp interprets @Me.Parameter as @(Me.Parameter) now instead of (@Me).Parameter before.
  • A bug of the preprocessor was fixed, which occurred if {$IFDEF Cpp} was used several time in the same file.
  • The resulting type of an expression like "not expr" is always evaluated as "bool" now, so that the logical binary operator is chosen now for the translation of "or" or "and" connections of such expressions.
  • In cases like "if(...) FreeAndNil(p)" additional brackets are inserted. Now the result is:
  • if(...)
  • delete p;
  • p = NULL;

New in Delphi2Cpp 1.3.0.1 (Jul 7, 2010)

  • Fractional digits were treated like digits in front of a decimal point. So a number like 1.002 became 1.2. This bug is fixed now.

New in Delphi2Cpp 1.3.0 (May 26, 2010)

  • The Windows conformity of the installation and user interface are improved.
  • The access to Arrays remains correct now, despite of the transformation of Delphi-arrays to 0 based C++ arrays. The value of the lower bound (Low) which the array in Delphi had is subtracted from the value of the index now. The functions "Low" and "High" yield the same values now in C++ which result in Delphi. The macro "HIGH" was renamed to "MAXIDX".
  • In the professional version of Delphi2Cpp there is now the option to insert the macros "DECLARE_DYNAMIC" and "IMPLEMENT_DYNAMIC" automatically, which are known from the Microsoft Foundation Classes (MFC) to obtain runtime information for classes.
  • As a real example of a translation from Delphi source code into C++, the excellent ATBinHex component of Alexey Torgashin was translated.
  • The price for Delphi2Cpp was raised once more, according to the extended abilities of the program.

New in Delphi2Cpp 1.2.9 (May 17, 2010)

  • Warnings and error and single steps of the translation are logged in an additional panel now.
  • By a more exact treatment of namespaces the quality of the translation was improved further.

New in Delphi2Cpp 1.2.8 (May 4, 2010)

  • The order of type definitions gets corrected now. The definitions are written, when defining type is known. At the same time, the recognition of the types at later positions in the code is improved. See in the help the section: "Order of type definitions".
  • Message handlers are translated now by means of the VCL_MESSAGE_HANDLER macro.
  • goto statements are translated now and the update contains many more other small improvements

New in Delphi2Cpp 1.2.7 (Apr 27, 2010)

  • Several new translation options have been added:
  • The special treatment of some VCL functions can now be switched off so that you can write your own translations for them.
  • The creation of comments on the translation can be switched off. In addition these comments start now with "/*#", so that they can easily be distinguished from other comments.
  • Delphi strings can alternatively be translated in standard strings now.
  • It can be chosen whether "String" is interpreted as "AnsiString" or "WideString".
  • For the functions for the substitution of the properties the prefixes can be defined freely.
  • In the professional version there is the possibility now to force a C-like output.
  • In addition, there are some improvements on the translation quality and some bug fixes again:
  • The wrong special treatment of the Insert procedure was corrected.
  • Initializations of local arrays which were partly missing are created now.
  • "FreeAndNil" will be replaced by "delete" now.
  • Errors of parsing newer versions of the VCL were eliminated. "SyncObjs.pas" is excluded from parsing.
  • Further improvements.

New in Delphi2Cpp 1.2.6 (Apr 20, 2010)

  • Much improved translation results, because:
  • the interpretation of structure parameters of functions in WinProcs.pas has changed in accordance with the CBuilder VCL
  • boolean and bitwise "and" and "or" operators are distinguished
  • default parameters in nested functions are taken into account
  • and there are many further detail improvements.
  • In addition, the access to elements is written now in the usual notation with the pointer operator "a->" instead of the previous notation "(*a).".
  • Superfluous set definitions are avoided.

New in Delphi2Cpp 1.2.5 (Apr 20, 2010)

  • The list of identifiers can be saved now, which was created by the preprocessor to unify their notations: The list can be loaded again for another session, so that the notations of the identifiers in the generated C++ output are the same as in the previous files.
  • In the professional version of Delphi2Cpp there is now an additional substitution table for the translator similar to the substitution table for the preprocessor.
  • The treatment of arrays has been revised. The strategy of indexation has changed (You can find more information to this point in the sections of the help: Static arrays, Open array parameters.)

New in Delphi2Cpp 1.2.4 (Apr 20, 2010)

  • Initialization and finalization of units.
  • Initialization of array's.
  • Several other small improvements.

New in Delphi2Cpp 1.2.3 (Mar 18, 2010)

  • Many small special improvements of the quality of translation.

New in Delphi2Cpp 1.2.2 (Mar 8, 2010)

  • Nested Delphi functions are broken up into normal member functions now. All needed parameters are passed to these functions.
  • Overwritten properties are overwritten in C++ now accordingly.

New in Delphi2Cpp 1.2.1 (Mar 1, 2010)

  • Delphi2CppInstall.exe installs a demo version of Delphi2Cpp now, which can be used without time limit. The demo program makes translations of the same quality as the licensed program. The amount of the output code, however, is restricted to 10000 characters for the implementation part and it isn't possible to load or save code and options. At the purchase of a license of Delphi2Cpp a link is delivered on a version of Delphi2Cpp in which the complete functionality of the program can be used.
  • Additional option for precompiled headers.
  • Improvement of the translation of pointers to pointers.
  • Cosmetic improvements:
  • a) instead of the unusual notation
  • (*fo).bar , now: fo->bar
  • b) instead of the unusual indentation of parenthsis:
  • if(...)
  • ...
  • now:
  • if(...)
  • ...

New in Delphi2Cpp 1.2.0 (Feb 18, 2010)

  • C++ code can optionally be generated for other compilers than the CBuilder too. For the other compilers Delphi properties are eliminated by corresponding calls of additional Read or Write methods.
  • Notations and translations of identifiers can be controlled by an individual translation table now.
  • The quality of the translation was increased further, particularly concerning the pointers to arrays, typecasts, __classid and much more.
  • The price for Delphi2Cpp was raised once more a little bit, according to the extended abilities of the program.

New in Delphi2Cpp 1.1.9 (Feb 18, 2010)

  • At places where C++ expects constant expressions, the values of constants are written in the translation now instead of the constants themselves.
  • For global functions is registered now if the return type is a pointer. This was forgotten till now.
  • The change in the last update to translate string parameter "(s : string)" as "(consts string& s)" was undone because this led to conflicts with the CBuilder VCL).
  • A fbug was fixed, by which often wrong translation alternatives were selected for special VCL functions.

New in Delphi2Cpp 1.1.8 (Feb 18, 2010)

  • The translation of the implementation part of the pas files is several times faster now than before.
  • Sub-functions of nested functions are treated correctly now. The nesting remains furthermore, though.
  • Improvements in the treatment of string additions and string parameters.

New in Delphi2Cpp 1.1.7 (Feb 18, 2010)

  • Many with-statements, which were not translated correctly until now, are analyzed and translated correctly now.
  • Many more small improvements

New in Delphi2Cpp 1.1.6 (Feb 18, 2010)

  • Declarations of classes are looked up in the units actually included only now.
  • Unit namespaces are marked correctly now with two colons in qualified identifiers. E.g.: Graphics:: ...
  • The determination of the list of the constructors of the predecessor classes was improved.

New in Delphi2Cpp 1.1.5 (Feb 18, 2010)

  • Error positions in the window of the Delphi source code were shifted now and then because they referred to the preprocessed code. The preprocessed code is shown on this window after the translation now.
  • Comments were reproduced only incompletely from the interface part. This was improved.
  • Constants of the interface part were translated as static constants in the C++- headers till now. This could lead to many warning messages of the compiler if the header was included in several files. The constants now are declared externally and in instantiated in the accompanying implementation file with their value now. However, this can result in faults in rarer cases if the values of the constants are already needed in the header.
  • Dimensions of arrays in C++ were calculted as differences of the upper and lower limitation of Delphi ranges till now. The upper limit is taken now as dimension, so that it is made sure that index access to the array doesn't exceed the limitation.
  • Many other improvements at several translation details.

New in Delphi2Cpp 1.1.0 (Feb 18, 2010)

  • Instances of structures are created as automatic variables and submitted as references to functions in the translated code now. Unlike this, furthermore class instances are manipulated as pointers.
  • "array of type"-parameters are interpreted per default as references on dynamic arrays now.
  • The notations of the TObject elements are provided in the preprocessor now. So the elements are recognized in any case.
  • Global functions and procedures are recognized now.
  • "String" is now correctly translated to "String", not to "AnsiString".
  • In consideration of another month of work, that was done to improve the translation quality, the price of Delphi2Cpp was increased. In the trial version the translation is cut off after 10000 characters now.

New in Delphi2Cpp 1.0.9 (Feb 18, 2010)

  • The overwritten constructors of a class are supplemented with the complete list of the not overwritten constructors automatically now.
  • A function is now translated correctly too, if the function name itself is used instead of the predefined variable "Result".
  • In calls like "foo(['hello', 'world'])" Delphi2Cpp decides now by the expected type of the parameter, whether a set or an array of const is passed.
  • A lot of other small compltements and improvements.

New in Delphi2Cpp 1.0.8 (Feb 18, 2010)

  • the recognition of variable types in with-statements was improved.
  • friend class declarations were added to classes with ancestors only. Now they are declared for all classes inside of a unit.

New in Delphi2Cpp 1.0.7 (Feb 18, 2010)

  • The bug was fixed, that the parser didn't recognize the names of especially treated VCL fiunction following on "inherited", e.g. "inherited delete".
  • Numbers beginning with '0', like '0943' were written unchanged into the output. But C++ regards them as octal numbers. Noe the leading '0' characters are removed.
  • The bug was fixed, that the exponent was separated by a blank in exponetial numbers.
  • Special parameter declarations were improved:
  • const Args: array of const -> const TVarRec * Args, const int Args_Size
  • const Value -> const int Value

New in Delphi2Cpp 1.0.6 (Feb 18, 2010)

  • If no ancestor type is specified when declaring a new object class, Delphi automatically uses TObject as the ancestor. In C++ this is made explicit now.
  • At positions, where resource strings are used, they are now substituted be the according macro, which loads the string.
  • A bug was fixed, which sometimes prevented the recognition of types in the current scope.

New in Delphi2Cpp 1.0.5 (Feb 18, 2010)

  • Constructors wihtout parameters aren't inserted any more.
  • Calls of constructors without parameters of the base class inside of the constructor of a derived class are commented out, e.g.
  • // inherited::Create;
  • the type information of overwriteen properties is evaluated now.
  • If the size of an array is specified by an enumerated type, the size is evaluated from the smallest and greatest value of the type.

New in Delphi2Cpp 1.0.4 (Feb 18, 2010)

  • Improvement: forward declarations of VCL classes were not used for the evaluation of pointer types
  • Missing constructors in derived classes are inserted automatically, e.g.
  • inline __fastcall virtual TDerivedComponent(TComponent* Owner) : inherited(Owner) { }

New in Delphi2Cpp 1.0.3 (Feb 18, 2010)

  • Treatment of sets has been improved further.
  • E.g. type TIntSet = set of 1..250; -> typedef System::Set < int/* range 1..250*/, 1, 250 > TIntSet;
  • Variables are m as extern now in the C++ headers and their instances are included into the implementation cpp-files.

New in Delphi2Cpp 1.0.2 (Feb 18, 2010)

  • doubled pseudo forward declaration like "class classname{}" is not generated any more
  • Improvement of assignements of sets.

New in Delphi2Cpp 1.0.1 (Feb 18, 2010)

  • the preprocessor executes include directives now
  • un/defines in not defined regions aren't executed any longer