Is this an Oxygene bug or by your design that attributes cannot be constructed with more than one parameter?
It is try for StructLayout as well as for MarshalAs
I am trying to port this c# example to a similar idea in my Oxygene project:
[StructLayout(LayoutKind.Sequential,
Pack = 1, CharSet = CharSet.Unicode)]
public struct DISPLAY_DEVICE
{
public int cb;
[MarshalAs(
UnmanagedType.ByValArray,
SizeConst=32)]
public char[] DeviceName;
[MarshalAs(
UnmanagedType.ByValArray,
SizeConst=128)]
public char[] DeviceString;
public int StateFlags;
[MarshalAs(
UnmanagedType.ByValArray,
SizeConst = 128)]
public char[] DeviceID;
[MarshalAs(
UnmanagedType.ByValArray,
SizeConst = 128)]
public char[] DeviceKey;
}
[StructLayout(LayoutKind.Sequential)]
MyTestRec = public record
public
[MarshalAs(UnmanagedType.I2)]newStripHebrewExport: INT; // compiles fine
[MarshalAs(UnmanagedType.SafeArray, VarEnum.VT_I2)]printInfo: PrintInfoArrayOfInt16; // Error
No matter what the second argument looks like in both attributes I am getting error E319.
(Pack = 1 would be a boolean expression comparing an unknown identifier Pack to 1. Contrast that to C#, where = is the assignment operator, and == the equality one).
If you select the value property of the MarshalAsAttribute link you sent, you can see that there are CustomMarshallers. Selecting this get you to this link that indicates the ability to have more than one agrument, to further identify the variable.