Windows mode

Top  Previous  Next

What is translated > Routines > Translation modes > Windows mode

This translation mode is used for functions that resemble Windows API-style functions, but are not necessarily COM-based.

 

It follows typical Win32 conventions for types, parameter passing, and calling conventions.

 

Characteristics

 

Portable compilers (MSVC, GCC, Clang):

 

typically __stdcall (or platform equivalent)

 

C++Builder:

 

__stdcall

 

Types:

 

Boolean -> BOOL

Integer / Longint -> LONG, DWORD, or UINT (depending on context)

 

Windows-specific types are preferred:

 

HWND

DWORD

LPVOID

WPARAM, LPARAM, etc.

 

Parameters:

 

var / out -> pointer (T*)

 

This reflects typical Windows API patterns where output values are returned via pointer parameters.

 

General Behavior

 

Emphasis on compatibility with Win32 API conventions
Use of pointer-based parameter passing instead of references
Preference for Windows-defined types over standard C++ types

 

 

Example

 

Delphi:

 

procedure GetValue(var Value: Longint);

 

C++ (Portable):

 

void __stdcall GetValue(LONG* Value);

 

C++ (C++Builder):

 

void __stdcall GetValue(LONG* Value);

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content