Quote Originally Posted by zreecu View Post
Try this way.
change the delegate declaration from

public delegate int SimpleDelegate(int x);

To:

[UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)]
public delegate int SimpleDelegate(int x);
That might be good but the thread is about a year old and also in native C++ so your post is a bit misplaced.