[Mono-devel-list] Embedding Mono - MonoArray
Tobias Kluge
kluge at ira.uka.de
Sat Jun 5 06:55:04 EDT 2004
Hi Friedrich,
try the little program I attached. This works for me but I don't know if
it matches your needs.
Best regards,
Tobias
Am Sa, den 05.06.2004 schrieb Friedrich Priewasser um 12:28:
> On Fri, 04 Jun 2004 16:56:41 -0700, Michael J. Ryan
> <tracker1_lists at theroughnecks.com> wrote:
>
> > doesn't this work?
> >
> > int[] MyArray = new int[2];
> > int[][] MyArray2 = new int[2][5];
> >
>
> I tried the following:
>
> int a[]={21,43};
> ...
> params[0]=a;
>
> It didn't work
>
> >
> > Friedrich Priewasser wrote:
> >> Can anyone tell me how to create a MonoArray for simple types like
> >> int's (for "complex" datatypes it allready works)?
> >> I tried to invoke the C# method "public void DoSomething(int[] values)"
> >> To do this i used the following code, but it didn't work
> >> (mono_runtime_invoke caused an error):
> >> ...
> >> array=mono_array_new(domain, mono_defaults.int32_class, 2);
> >> mono_array_set(array,int,0,21);
> >> mono_array_set(array,int,1,43);
> >> params[0]=array;
> >> desc = mono_method_desc_new (":DoSomething(int[])",TRUE);
> >> method = mono_method_desc_search_in_class (desc, klass);
> >> mono_runtime_invoke (method,NULL,params,NULL);
> >
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040605/0a198cb4/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cs
Type: text/x-csharp
Size: 544 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040605/0a198cb4/attachment.bin
More information about the Mono-devel-list
mailing list