[Mono-list] Re: P/Invoke IntPtr versus byte[]

Marcus mathpup@mylinuxisp.com
Sat, 3 Jul 2004 15:47:08 -0500


I was writing my reply, saying that you probably pasted the wrong method 
signature.

Is there some particular reason that you do not know the type in advance? It 
would be easier if you could do that because you would then be able to write 
a precise signature for the P/Invoke method.

By the way, is mdArray a field or local variable?


On Saturday 03 July 2004 3:26 pm, Tim Rädisch wrote:
> One Copy&Paste-error. The first DllImport was not byte[] but IntPtr :)
>
> [...]
>
> Because it is a "const void*" I used the following DllImport statement
>   [ DllImport(lib) ]
>   static extern void multiDimArrayTest( IntPtr elems );
> and this methode call
>   multiDimArrayTest( GCHandle.Alloc( mdArray,
> GCHandleType.Pinned).AddrOfPinnedObject() );
>
> [...]