>
> I'd like to call a managed method from c which returns a GLib.List.
> I seem to be unable to do this, however..
> my managed code looks like:
>
> public GLib.List Test()
> {
> GLib.List list = new GLib.List(typeof(string));
> list.Append("eins");
> list.Append("zwei");
> list.Append("drei");
> list.Append("vier");
>
> return list;
> }
>
> my unmanaged code looks like:
>
> MonoObject *o = mono_runtime_invoke (method, instance, NULL, &ex);
> GList *list = (GList *)o;
>
That is because the managed GList object is merely a wrapper around the real
GList.
What you are getting back is not a pointer to the C GList, but a pointer to
the managed GList; What you need to do is return the unmanaged pointer
that is wrapped by the C# GList, that would be the GList.Handle.
Miguel
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list