Struct marshal in C#

前端 未结 2 2136
深忆病人
深忆病人 2021-02-09 22:17

I have the following struct in C#

unsafe public struct control
    {
        public int bSetComPort;
        public int iComPortIndex;
        public int iBaudRa         


        
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-09 22:34

    SizeOf doesn't work on arrays. Use array.Length * Marshal.SizeOf(elementType) instead.

提交回复
热议问题