Yes, that will work, right up until someone runs the library on 64bit windows :) If you don't care about that platform, this would be the easiest way to work in nearly all of the other platforms.
Alan. On Thu, Mar 25, 2010 at 11:06 AM, Robert Jordan <[email protected]> wrote: > On 25.03.2010 10:17, Mathias Tausig wrote: >> Hello! >> >> I am writing a wrapper for a c library which uses the c datatype >> "unsigned long" a lot. According to >> http://www.mono-project.com/Interop_with_Native_Libraries , unsigned >> long maps to the .NET type uint on a 32bit architecture and to ulong on >> a 64-bit one. >> Is there some sort of best practice, for achieving to write a library >> which can work on both architectures? > > Use [U]IntPtr in the p/invoke signature. > > Robert > > _______________________________________________ > Mono-list maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-list > _______________________________________________ Mono-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-list
