Access Violation Exception/Crash from C++ callback to C# function

后端 未结 4 419
时光说笑
时光说笑 2021-01-12 21:22

So I have a native 3rd party C++ code base I am working with (.lib and .hpp files) that I used to build a wrapper in C++/CLI for eventual use in C#.

I\'ve run into

4条回答
  •  说谎
    说谎 (楼主)
    2021-01-12 22:22

    I think the stack got crushed because of mismatching calling conventions: try out to put the attribute

     [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
    

    on the callback delegate declaration.

提交回复
热议问题