News for hackers. Stuff that matters.
Re:Try Out Rust IDE Support in Visual Studio Code by vvanders on Saturday August 19, 2017 @10:38AM (#15053608)
Nothing public unfortunately.

It's pretty straightforward though. Just declare a delegate with the same type signature as a your C function callback. Add that as the signature passed in to a native function and C# will make sure to marshal it to a standard C function pointer.

Only catch is if you want to keep a hold of the pointer in native you need to make sure to create a GCHandle to the passed in delegate with an identical lifetime. Otherwise the GC will collect the delegate from underneath you.

There are no comments on this comment yet.