I send a struct with 3 booleans from C# to C++ with PINVOKE.
There is no example for this.
But you have to add [MarshalAs(UnmanagedType.I1)] to get the right size. Otherwise the values are not correct on the C++ side.
Example:
public struct Bla
{
public float fooFloat;
[MarshalAs(UnmanagedType.I1)] public bool foo1;
[MarshalAs(UnmanagedType.I1)] public bool foo2;
[MarshalAs(UnmanagedType.I1)] public bool foo3;
}
Can you add a example for that in PInvokeLib?
I send a struct with 3 booleans from C# to C++ with PINVOKE.
There is no example for this.
But you have to add [MarshalAs(UnmanagedType.I1)] to get the right size. Otherwise the values are not correct on the C++ side.
Example:
Can you add a example for that in PInvokeLib?