[Mono-dev] mono embed: passing arrays from and to unmanaged code

Paolo Molaro lupus at ximian.com
Thu Jan 12 10:48:35 EST 2006


On 01/11/06 Davide Morelli wrote:
> I'm trying to pass arrays of floats and strings from and to mono embed from 
> a C software with no luck.
> 
> I'd need to call (from C) managed functions like:
> void TakeManyStrings(string [] list);
> void TakeManyFloats(float [] list);
> 
> i'd also need to do the same from managed to umnanaged: call a C function 
> from C# passing an array of strings and floats.
> 
> I couldn't find any useful manual page or source code on how to do so..
> could anybody point out any reference to me?

See mono/docs/internal-calls.
An array argument passed to an icall will look like a MonoArray*
argument on the C side.
A MonoArray* is a reference so it is passed to managed functions like
any other reference. See mono/samples/embed/*.c for many invocation
examples.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list