You are not logged in.
Pages: 1
Hello Arnaud,
I'm using your excellent mORMot library, specifically Client-Server services via interfaces as described in section 16 of the documentation.
But I am getting a "record too small" error, raised from line 52734 in mORMot.pas
smvRecord:
if ArgTypeInfo^.RecordType^.Size<=PTRSIZ then
raise EInterfaceFactoryException.CreateUTF8(
'%.Create: % record too small in %.% method % parameter',
[self,ArgTypeName^,fInterfaceTypeInfo^.Name,URI,ParamName^]) else
SizeInStorage := PTRSIZ; // handle only records when passed by ref
else
SizeInStorage := PTRSIZ;
An example record that causes this is:
TMyRec =record
Prop :string;
end;
If I change it to:
TMyRec =record
Dummy: Integer;
Prop :string;
end;
It works.
But a simple record just containing a string should work in my opinion. Maybe the condition should be:
if ArgTypeInfo^.RecordType^.Size<PTRSIZ then
So less than and not less than or equals to? What do you think?
Thanks for a wonderful library!
Adrian
Offline
The whole SOA process expects the record parameters to be passed by reference (i.e. as a pointer).
Writing < PTRSIZ would make access violations.
This is a limitation of the calling convention used by Delphi.
If your record contains only a string, pass a string parameter.
If you need a dedicated type, define a custom string type.
Offline
Pages: 1