Pass a function pointer from C++ to be called by C# - Arguments of functions include a wide char string (LPCWSTR)

后端 未结 2 877
栀梦
栀梦 2020-12-19 21:15

I am writing a C# library to be used by native C++ application. I am using C++/CLI as the Interoperability mechanisim.

I require to pass a callback function from C++

2条回答
  •  攒了一身酷
    2020-12-19 21:54

    See the little-known UnmanagedFunctionPointer attribute, which is like DllImport for delegates, if you'd like to use CharSet or whatnot.

提交回复
热议问题