You are not logged in.
Pages: 1
In our interfaces we are using types kind of "set of TMyEnumeration". Is it possible allow enumerations with more than 32 members in it?
Unfortunatly in such cases an exception is thrown at TInterfaceFactory.Create method.
EInterfaceFactoryException: TInterfaceFactoryRTTI.Create: TMyImplementation set invalid SizeInStorage=0 in IMyInterface.MyMethod method AMyEnum parameter
Some workouround would help:
function TEnumType.SizeInStorageAsSet: Integer;
begin
case MaxValue of
0..7: result := 1;
8..15: result := 2;
16..31: result := 4;
32..63: result := 8; // <--- added
else result := 0;
end;
end;
Is there a reason for limiting? We are using Delphi 10.3 Update 1.
Thanks in advance.
Offline
IIRC the serialization may use a PtrInt integer for serialization as number.
So I guess your modification may not work as expected for Win32 target.
I will check tomorrow what is the code state about it.
Offline
Hi,
we also got into trouble because of limitation to 32 members.
Is it ok to expand to 8 ?
thank you
Offline
Please try https://synopse.info/fossil/info/d033ec7dee
I guess it is OK: our code seems to use Int64 values, not PtrInt values.
Note that mORMot 2 has no such limitation.
Perhaps time to switch.
Offline
Pages: 1