对 PInvoke 函数的调用导致堆栈不对称问题

2025-11-03 21:01:28

1、解决方法很简单,只要添加属性: CallingConvention=CallingConvention.Cdecl即辞掩可毙珠。

 互摸侧

例如:[DllImport("TestApi.dll")]   internal extern static IntPtr TestApi(); 

添加属性CallingConvention=CallingConvention.Cdecl

改成[DllImport("TestApi.dll",CallingConvention=CallingConvention.Cdecl)]   internal extern static IntPtr TestApi(); 即可。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
相关推荐
  • 阅读量:135
  • 阅读量:68
  • 阅读量:83
  • 阅读量:108
  • 阅读量:96
  • 猜你喜欢