I use mono_object_unbox to get an object instance (Vector2) passed from C# to
C++.
C++
__declspec(dllexport) void SetPosition(MonoString* ms, MonoObject* mo)
{
        Vector2 pos = *(Vector2*)mono_object_unbox(mo);
}

C#
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void SetPosition(string name, object o)

If I need to pass an object as ref or out instead of value, how can I
implement it in C++ side ?

Like this sample, I want to pass object o as ref.
C#
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern void SetPosition(string name, ref object o)



--
View this message in context: 
http://mono.1490590.n4.nabble.com/How-to-pass-an-object-as-ref-or-out-tp4662539.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to