texttransformer.jpg

11/18/2024

Delphi2Cpp 2.6.0

1) Fully redesigned interface support

Delphi2CB 2.6.0 now provides a precise mapping of Delphi interface mechanics to the native C++Builder model:

  • Use of __interface and __uuidof for GUID-based interfaces
  • Automatic reference counting managed by the C++Builder RTL
  • Built-in QueryInterface, Supports, and as integration
  • New utility functions for safe casting and runtime type checks
  • Full support for multiple interface inheritance

This makes it possible to translate Delphi interfaces 1:1 into valid, compilable C++Builder code.

2) New core module d2c_sysinterface.h

A new internal module consolidates all key interface utilities and helper types:

  • DiOut - a safe out-parameter wrapper for QueryInterface
  • as_di<T> - type-safe dynamic interface cast
  • FromInterface() - reconstructs the implementing TObject*
  • Supports() - runtime check for implemented interfaces
  • ObjectIs() - class type check equivalent to Delphi’s is operator

These utilities form the foundation of Delphi2CB's new interface translation layer.

3) Enhanced translation of interface declarations

Delphi2CB automatically recognizes GUIDs in Delphi interfaces and converts them into
INTERFACE_UUID("{...}") declarations in proper C++Builder syntax.

Delphi

type
IFoo = interface
['{12345678-1234-1234-1234-1234567890AB}']
procedure DoSomething;
end;


C++Builder

__interface INTERFACE_UUID("{12345678-1234-1234-1234-1234567890AB}") IFoo : public IInterface
{
virtual void __fastcall DoSomething() = 0;
};


The result is clean, idiomatic C++Builder code that compiles without modification.


4) Support for TInterfacedObject and TCppInterfacedObject

Delphi2CB now directly uses the native Embarcadero classes: TInterfacedObject and TCppInterfacedObject

5) Better error handling and diagnostic exceptions

New helper functions provide detailed runtime feedback when interface casts fail:

  • qi_as_throw<T> - throws EIntfCastError on invalid interface casts
  • from_interface_or_throw() - verifies the correct class type at runtime

These ensure full behavioral consistency with Delphi, including proper exception types like EIntfCastError and EInvalidCast.


10/28/2024
see Delphi2Cpp 2.5

08/26/2024

There is now an additional version of the Synedit components translated for C++Builder for the modern 64-bit compiler. The previous versions have also been partially updated.

https://github.com/dm-e/SynEditCb
further see Delphi2Cpp 2.4

10/19/2023
Delphi2CB 2.3
Conversion of DFM files to C++

The code of DFM files can now optionally be converted into C++ code that is executed at runtime when the form or a frame is created. Essentially, the DFM code becomes to a series of simple assignments of values to component properties. Delphi2Cpp also manages to map other sometimes complex serialization actions in an intuitive and simple way. For this purpose, special routines are called which do not assign the values to the properties directly, but rather pass them as arguments to the routines, in which further actions can then be carried out. Especially for third-party components, Delphi2Cpp can be configured to call such user-defined functions.
By translating the DFM code, GUI applications can be built in C++Builder that do not require any DFM files at all. For other compilers, converting the DFM code is the essential bridge to using C++ GUI libraries.

More details about converting DFM files

Delphi2CB 2.2
01/31/2023

Adopting changes to Delphi2C# to facilitate translation of incomplete code

  • Recursive search for required units during translation
  • Optional generation of dummy code
  • Exclusion of certain files from translation
  • Use of a "cover" file for unknown types
  • Identifiers can be replaced by complex expressions

Delphi2CB 2.1
02/07/2022
  • Delphi inline variables and constants become to C++ local variables and constants
  • Large ranges in case statements are shifted to the default section of a switch-statement now
  • Check of loop variable types, to prevent infinite loops
  • There is a new option to normalize namespace as C++Builder does
  • Simplified manipulation of initialization/finalization order of units
  • For C++Builder there is the new helper function DynamicArrayPointer to pass dynamic arrays
  • Initialization Finalization and Assign operators in records are parsed and output, but not automatically called in C++
  • The "Comp" type, which only exists for backwards compatibility, has been removed to avoid confusion with commonly used variables of that name
  • The code translated to C++ with Delphi2Cpp is now updated and hosted on GitHub
  • The video of the German presentation at CodeRage 2021 has now been uploaded to YouTube in three slightly expanded parts in English


9.9.2021

Delphi2CB released


   deutsch Deutsch

 

 
Latest News
11/18/25
Delphi2CB 2.6: Delphi Interfaces [more...]

10/28/24
Delphi2CB 2.5: Symbol names matching declaration case [more...]



"Amazing, I actually managed to do it on both projects."

Christoph Wildensee
auditplan-xp October 2, 2024



"Though we have not finished the conversion yet, I'm glad that we've found you and could transform Eurocap to C++ with the help of Delphi2CB and you. (And I'm also glad that we could help you to make Delphi2CB better😉)"


Gáspár Huba


 
This website is generated from plain text with [Minimal Website ]

Minimal Website
Minimal Website is made with TextTransformer

TextTransformer
TextTransformer is made with Borland CBuilder

  borland