Declare your function pointer as typedef void (*FuncPtr)(int i);
PhrostByte wrote:Probably not, but the exception is still being thrown Anyone have a solution?
I wrote a simple bit of code to replicate this and it works, or rather I can replicate either of the two problems you mentioned. Without the GCHandle a NPE is thrown in the dllimport'ed function that calls the delegate from C (after it has actually done the
callback), and with the handle I get ArgumentException thrown about non-blittable types.