On 17.04.2014 06:26, carmack2000 wrote:
Hi Robert,
Thanks for your tips but I still don't understand how to unbox a ref-type.
It looks mono_object_unbox only can handle valuetype, not ref-type.
So could you please write more lines of code of implementation for an
example for this void
After I followed your code I got this error:
Unhandled exception at 0x100b8c87 in MonoScriptingTest.exe: 0xC005:
Access violation reading location 0x.
I'll look into this.
You said 'This is no better than the former non-ref version.' If I want to
use ref-object to return values
On 17.04.2014 16:55, carmack2000 wrote:
After I followed your code I got this error:
Unhandled exception at 0x100b8c87 in MonoScriptingTest.exe: 0xC005:
Access violation reading location 0x.
I'll look into this.
You said 'This is no better than the former non-ref version.' If I want
On 17.04.2014 18:33, Robert Jordan wrote:
On 17.04.2014 16:55, carmack2000 wrote:
After I followed your code I got this error:
Unhandled exception at 0x100b8c87 in MonoScriptingTest.exe: 0xC005:
Access violation reading location 0x.
I'll look into this.
You said 'This is no better
IT WORKS !
Thank you so much Robert !
--
View this message in context:
http://mono.1490590.n4.nabble.com/How-to-pass-an-object-as-ref-or-out-tp4662539p4662547.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list
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
On 16.04.2014 22:31, carmack2000 wrote:
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#
Hi Robert,
Thanks for your tips but I still don't understand how to unbox a ref-type.
It looks mono_object_unbox only can handle valuetype, not ref-type.
So could you please write more lines of code of implementation for an
example for this void SetPosition(MonoString* ms, MonoObject** mo) ?