t2t-soft

09/01/2026

Delphi2C# 2.8.0


Revised Pointer Simulation in Delphi2C#

With the current update, Delphi2C# introduces a thoroughly revised pointer simulation. It supports typical Delphi constructs such as Pointer, typed pointers, PChar, GetMem, FreeMem, Move, FillChar, record pointers, and pointer arithmetic.

The pointer types are implemented as small C# structs. This gives pointer assignments more Delphi-like behavior: copied pointers have independent positions while still referring to the same underlying memory.

All pointer types use a shared memory model. The underlying memory may be, for example, a managed array, a dynamic array, an explicitly allocated memory area, an address managed elsewhere, or a UTF-16 character buffer. Conversions between Pointer, Pointer<T>, UntypedPointer, and PChar normally do not copy the data.

For each kind of pointer, it is clearly defined how far the pointer moves during arithmetic operations:

  • Pointer and UntypedPointer move byte by byte.
  • Pointer<T> moves element by element.
  • PChar and PWideChar move character by character.

Memory management has also been unified. Memory areas allocated with GetMem or similar functions are released with FreeMem. Copied pointers therefore do not become additional owners of the same memory.

Move and FillChar consistently use byte counts, support both array memory and explicitly allocated memory areas, and perform bounds checks whenever the size of the memory area is known. Move also handles overlapping memory areas.

PChar supports non-copying views over char[] buffers as well as read-only views over C# strings. Because C# strings are immutable, writable string operations use explicit character buffers.

The revised pointer simulation therefore provides the fixed foundation for translating pointer-based Delphi routines to C#.

The use of the pointer simulation is now mandatory. It can no longer be disabled as an option and is now a fixed part of the runtime support generated by Delphi2C#. Other obsolete options have also been removed.


Improved TObject and TClass Support

Delphi2C# now uses a revised runtime model for TObject and TClass.

Delphi destructors are no longer generated only as C# finalizers. Instead, they are translated to virtual Destroy() methods. Free() calls this method directly, which more closely matches Delphi’s deterministic object lifetime behavior. In addition, a null-safe helper function TObject.Free(obj) is available so that Delphi code such as Obj.Free can be translated correctly even when Obj may be nil.

TClass has also been improved. Delphi class references are now represented as runtime metaclass values. This makes operations such as ClassType, ClassName, ClassParent, InheritsFrom, and object creation through class references more consistent and reduces the amount of additional code generated in translated classes.

These changes improve compatibility for object lifetime handling, class references, metaclass comparisons, and factory-style code.


Revised RTL Units and Improved Pointer Compatibility

The translated System.SysUtils Unit has been extensively revised. A key focus is compatibility with the updated pointer simulation, along with improved support for TObject and TClass.

The pointer simulation primarily serves as a compatibility layer for translated Delphi code. Internally, the revised RTL classes use optimized pure C# code and managed .NET data structures wherever possible. This preserves the Delphi-style interface without unnecessarily reproducing pointer-based operations inside the runtime.

In addition to System.SysUtils, the translated classes from System.Classes and System.Generics.Collections have also been revised. This includes improvements to lists, generic collections, enumerators, dictionaries, and object-owning containers.



05/18/2026

Delphi2C# 2.7.0

There are no C#-specific improvements. Only bugs in the shared codebase of the various Delphi converters have also been fixed here.


11/18/2025

Delphi2C# 2.6.0

The new 2.6.0 update of Delphi2C# brings a number of improvements
to the translation of interface-related Delphi code into C#.

Highlights:

1. Improved support for Delphi interfaces without GUIDs
  • Interfaces without explicitly declared GUIDs are now treated as regular .NET interfaces.
  • Optionally, placeholder GUIDs can be generated to preserve the semantics of Supports(...).
2. Enhanced translation of `as` and `is`
  • The Delphi `as` operator is no longer translated using the C# `as` keyword, but instead with a direct type cast. This better matches Delphi behavior.
  • The `is` operator is translated directly as-is to C#.
  • The `Supports(...)` function is still translated if it was used in the original Delphi code.
3. Interface translation features
  • New dummy class `TInterfacedObject`
  • To maintain compatibility with Delphi-style class hierarchies, a .NET-centric version of `TInterfacedObject` is now generated by default. It optionally includes methods like `AddRef()` and `Release()` to prevent translation errors.

Important note:

COM compatibility in Delphi2C# remains internal and experimental. The tool produces purely .NET-compatible C# translations. Full COM interop is not the goal of this translator.


10/28/2024

Delphi2C# 2.5.0

Symbol names matching declaration case

When converting from Delphi to C++, it is essential to ensure consistent capitalization across all identifiers. Previously, this was achieved by enforcing a uniform notation for all identifiers that differed only in letter case. However, starting with version 2.5.0, there is now an option to retain the original case used in each identifier's declaration. This option is now enabled by default, and the previous approach is considered deprecated.

For example in the following unit there are defined a constant, a property and a parameter with the names "name", "Name" and "NAME".

unit casesensitivity;

interface

const
  name: string = 'DefaultName';

type
  TPerson = class
  private
    FName: string;
  public
    property Name: string read FName write FName;
    procedure DisplayInfo(NAME: string);
  end;

implementation

procedure TPerson.DisplayInfo(Name: string);
begin
  WriteLn('Parameter Name: ' + Name);
  WriteLn('Property Name: ' + Self.Name);
  WriteLn('Constant Name: ' + casesensitivity.Name);
end;

end.

By use of the deprecated "unify all cases" option all symbols were given identical names and the DisplayInfo procedure became to:

public void DisplayInfo(string name)
{
  Console.WriteLine("Parameter Name: " + name);
  Console.WriteLine("Property Name: " + this.name);
  Console.WriteLine("Constant Name: " + casesensitivity.casesensitivityInterface.name);
}

With the new option the three symbol names all are used in the procedure DisplayInfo, This is possible, because they are declared in different scopes. Delphi2Cpp converts the procedure for C++Builder to:

public void DisplayInfo(string NAME)
{
  Console.WriteLine("Parameter Name: " + NAME);
  Console.WriteLine("Property Name: " + this.Name);
  Console.WriteLine("Constant Name: " + casesensitivity.casesensitivityInterface.name);
}

The option to match the declaration names avoids problems that arise when different parts of the code are translated with different identifier lists





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

- Adoption of the feature of Delphi2Cpp to convert the code from DFM files. This 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 is a series of simple assignments of values to component properties. Delphi2C# 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 directly to the properties, but rather pass them as arguments to the routines, in which further actions can then be carried out. Specifically for third-party components, Delphi2C# can be configured to call such custom functions. This conversion of DFM code is the essential bridge to using C# GUI libraries.

More details to the DFM conversion

01/31/2023
Facilitated 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
  • The use of pointer simulation is now optional
  • A file with global usings directives can now be created
  • Unification of string and character constants (both as strings)
  • Destructors are removed
  • Identifiers can be replaced by complex expressions

04/02/2020 documentation actualized
10/16/2019 offer of Delphi2C# beta


   deutsch Deutsch


 
Latest News
09/01/26
Delphi2C# 2.8.0: Fundamentally revised pointer simulation [more...]

05/18/2026
Delphi2C# 2.7.0: Translation heuristics [more...]



"So, all in all we are very pleased with Delphi2C#."


Henk van der Meer
Innomeer 02/02/2023


"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 C++Builder

  Borland