Re: [Mono-list] mono embedding in c++: how to get a array from C# code?

2015-11-09 Thread Jonathan Mitchell
> On 9 Nov 2015, at 00:22, sunsflower wrote: > > > and how can I pass a pointer to mono?... > > stuct test > { >int index; >string name; > }; > > > MonoMethod* method = mono_class_get_method_from_name(klass, "testfunc", 2); > MonoException* ex; > typedef

Re: [Mono-list] mono embedding in c++: how to get a array from C# code?

2015-11-08 Thread Jonathan Mitchell
> On 8 Nov 2015, at 02:41, sunsflower wrote: > > I've tried to use a monoclassfield but it doesn't work with a string array in > C#. the return value is invalide. > c++: > > MonoClassField* field; > field = mono_class_get_field_from_name(klass, "entry"); >

Re: [Mono-list] mono embedding in c++: how to get a array from C# code?

2015-11-08 Thread sunsflower
//I reckon that mono_field_get_value will return a MonoArray, //Try something a bit like this: // //MonoArray* monoArray = NULL; //mono_field_get_value(obj, field, monoArrayl); //MonoString *monoString = mono_array_get(monoArray, MonoString *, 0) //char *s = mono_string_to_utf8(monoString); //

Re: [Mono-list] mono embedding in c++: how to get a array from C# code?

2015-11-08 Thread sunsflower
thanks, it did work! only I need to pass a monoarray** to this function "mono_field_get_value(obj, field, );" . Mono is so poor documented, but it is really good! -- View this message in context:

[Mono-list] mono embedding in c++: how to get a array from C# code?

2015-11-07 Thread sunsflower
I've tried to use a monoclassfield but it doesn't work with a string array in C#. the return value is invalide. c++: MonoClassField* field; field = mono_class_get_field_from_name(klass, "entry"); char* val[100]; MonoString* monoval[100];