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

sunsflower ssfxtr at outlook.com
Sun Nov 8 02:41:51 UTC 2015


I've tried to use a monoclassfield but it doesn't work with a string array in
C#. the return value is invalide. 
c++:
<code>
	MonoClassField* field;
	field = mono_class_get_field_from_name(klass, "entry");
	char* val[100];
	MonoString* monoval[100];
	mono_field_get_value(obj, field, monoval);		
	val[0] = mono_string_to_utf8(monoval[0]);
</code>
C#
<code>
    public class SAssemblies
    {
        string[] entry = new string[] {
            "add",
            "subtract"
        };
    }
</code>
thanks!



--
View this message in context: http://mono.1490590.n4.nabble.com/mono-embedding-in-c-how-to-get-a-array-from-C-code-tp4666903.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list