Marshaling a C++ two-dimensional fixed length char array as a structure member

前端 未结 4 1388
Happy的楠姐
Happy的楠姐 2021-01-13 17:03

I am trying to call an unmanaged C++ function, that has a structure as an input parameter. The structure is defined in the header file like this:

struct MySt         


        
4条回答
  •  一生所求
    2021-01-13 17:46

    [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst=150)]
     public char[] aaszNames;
    

    That marshalling type looks well. Probably issue in function call, or bad memory allocation/

提交回复
热议问题