#1 2015-07-14 00:58:27

bigheart
Member
Registered: 2014-08-01
Posts: 53

How to make generated code CreateFromVariant from Cross wrapper

Hello.

I'm using mORMot with Firemonkey generated client code from crossplatform wrapper as blow:

function TMyService.GetData(out ACollect: TMyCollect): Boolean;
var res: TVariantDynArray;
begin
  fClient.CallRemoteService(self,'GetData',2, // raise EServiceException on error
    [],res);
  ACollect.Free; // avoid memory leak
  ACollect := TMyCollect.CreateFromVariant(res[0]);
  Result := res[1];
end;

But when compile the client code, undeclared id "CreateFromVariant" is issued.

How can i find or create the CreateFromVariant function?

Last edited by bigheart (2015-07-14 01:09:57)

Offline

#2 2015-07-14 09:25:50

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How to make generated code CreateFromVariant from Cross wrapper

Is a TSQLRecord constructor, defined in SynCrossPlatformRest.pas.

Offline

Board footer

Powered by FluxBB