[Mono-dev] Marshalling

Jonathan Pryor jonpryor at vt.edu
Thu Aug 23 07:26:20 EDT 2007


On Thu, 2007-08-23 at 11:31 +0200, Jouini Karim wrote:
> And i'm wondering : is there any example on how to pass delegates ?

http://msdn2.microsoft.com/en-us/library/ms172513(VS.80).aspx

You can also look at Mono.Posix.dll's signal(3) wrapper:

http://anonsvn.mono-project.com/source/trunk/mcs/class/Mono.Posix/Mono.Unix.Native/Stdlib.cs

In particular:

	public delegate void SignalHandler (int signal);

	public class Stdlib {
	    [DllImport (LIBC, CallingConvention=CallingConvention.Cdecl,
	        SetLastError=true, EntryPoint="signal")]
	    private static extern IntPtr sys_signal (int signum,
	        SignalHandler handler);

	}

 - Jon





More information about the Mono-devel-list mailing list