Delphi Interface mode

Top  Previous  Next

What is translated > Routines > Translation modes > Delphi Interface mode

This translation mode is used for Delphi-style interfaces, including interfaces derived from IInterface.

 

It represents a Delphi-oriented interface model that may be COM-compatible internally, but preserves Delphi semantics and usage patterns.

 

Characteristics

 

Interfaces

 

Portable compilers (MSVC, GCC, Clang):

 

mapped to DelphiInterface<T>

 

C++Builder:

 

mapped to DelphiInterface<T> or native C++Builder interface types

 

Types

 

Boolean -> bool

Standard Delphi types are preserved (no Windows API type substitution)

 

Parameters

 

var / out -> T& (reference)

 

Calling convention

 

Portable compilers:

 

default calling convention

 

C++Builder:

 

usually __fastcall (Delphi-compatible)

 

General Behavior

 

Preserves Delphi-style interface usage
Uses reference semantics instead of pointer-based API patterns
Does not enforce COM ABI requirements (such as HRESULT return values or __stdcall)

 

Example

 

Delphi

 

function GetIsRecyclable: Boolean;

 

C++ (Portable)

 

bool GetIsRecyclable();

 

C++ (C++Builder)

 

bool __fastcall GetIsRecyclable();

 

Notes

 

Even if an interface is technically COM-based, this mode is selected when:

 

the method follows Delphi-style signatures
no native COM ABI pattern is detected

 

Typical indicators include:

 

return values instead of HRESULT
absence of stdcall / safecall
use of Delphi-specific types

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content