#1 2025-08-06 09:09:05

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 572

Managed Records not initialized by "CallMethod"

Hi Arnaud, im using a managed Record as Result of a SOA function.

result = packed record
  
public
    class operator Initialize(out Dest : result);
end;

// SOA Function:

function Test : result;

if Test is called directly result.Initialize is called
if it is called remote (by mormot.core.interface.CallMethod) result.Initialize is not called and record uninitialized

is it possible to call it ?

Last edited by itSDS (2025-08-06 09:09:25)


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#2 2025-08-06 09:27:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,132
Website

Re: Managed Records not initialized by "CallMethod"

Delphi managed records are not supported by the framework yet.

You could use a class instead (since the class instance would be managed by the SOA).
Or just define your own initialization method, or make "result := Default" in your implementation.

Offline

Board footer

Powered by FluxBB