Changing a C# delegate's calling convention to CDECL

前端 未结 1 1086
时光取名叫无心
时光取名叫无心 2020-12-01 14:10

I have had this problem with C# when I was using DotNet1.1

The problem is this. I have an unmanaged dll, which has a function which takes a function pointer (among o

相关标签:
1条回答
  • 2020-12-01 15:01

    By default the p/invoke system wraps your delegate in a stdcall function. You can change the generated wrapper's calling convention by using the UnmanagedFunctionPointer attribute:

    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    public delegate void MyDelegate();
    
    0 讨论(0)
提交回复
热议问题