Translation modes

Top  Previous  Next

What is translated > Routines > Translation modes

Delphi2Cpp distinguishes between different translation modes in order to generate C++ code that matches the semantics of the original Delphi code as closely as possible.

 

Each function or method is analyzed heuristically and assigned one of the following modes:

 

Delphi
Windows
Delphi Interface
Com API

 

These modes influence:

 

type mapping (e.g. Boolean -> bool vs BOOL)
parameter passing (T& vs T*)
calling conventions (__fastcall vs __stdcall)
interface handling (DelphiInterface<T> vs raw COM pointers)

 

 

Heuristic Detection

 

The translation mode is determined using a combination of:

 

function signature (return type and parameters)
calling convention (stdcall, safecall)
used types (HRESULT, IDataObject, HWND, etc.)
declaring unit (Winapi.*, ActiveX, etc.)
owner type (e.g. COM interface implementation)
detection of Delphi wrapper patterns

 

 

Default Behavior

 

Unless explicitly stated otherwise, all explanations in this documentation refer to this mode.

 

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content