我从编组uint8_t中得到数组中的内容0。我无法避免错误。
C++:
typedef struct {
uint8_t tst[64];
} Info_t;C#:
public struct Info_t
{
public byte[] tst;
public Info_t(bool initializeByteArrays)
{
tst=new byte[64];
}
}
[DllImport(@"D.dll", EntryPoint = "connect", ExactSpelling = false)]
public static extern ushort connect(Info_t test);
Info_t dd = new MainForm.Info_t(true);
ushort res = connect(dd);产出:
dd.tst=0 ...dd.tst63=0
发布于 2019-11-12 07:58:00
https://stackoverflow.com/questions/58804603
复制相似问题