更新时间:2023-02-07 22:16:47
您应该调用PtrToStructure的重载,该重载期望使用类型而不是对象。正是导致错误的原因:
You should call the overload of PtrToStructure that expects a type instead of an object. That's what's causing the error probably:
var ver = Marshal.PtrToStructure(ptr, typeof(MathServLib.sVersionStruct));