Avatar of festijazz
festijazz

asked on 

[Help] C#: Marshalling of a structure with a float array field.

Hello Everyone,

I have a question about the marshalling of a structure with a float array field defined.
How should I defined the marshalling type ?

        private const int _LIMIT_ROWS = 128;
        private const int _LIMIT_COLS = 2;

        private struct stBNC
        {
            [MarshalAs(UnmanagedType.I4)]
            public int Rows;

            [MarshalAs(UnmanagedType.I4)]
            public int Cols;

            [[b]MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)]
            public float[_LIMIT_ROWS * _LIMIT_COLS] Level;[/b]
        }

Open in new window


Thank you very much in advance.
Best regards.
MiQi
C#

Avatar of undefined
Last Comment
festijazz

8/22/2022 - Mon