[Mono-list] passing MonoArray from c#

Robert Jordan robertj at gmx.net
Sun May 3 15:38:05 EDT 2009


fozzie wrote:
> It runs the constructor for me on Windows Vista 32-bit, anyway. Perhaps it's
> different on the platform you are using.

You're right. It's only needed when the ctor has arguments.


Change this:

	link = (DataLink*)mono_array_get(retLinks, DataLink*, 0);

to
	link = mono_array_addr(retLinks, DataLink, 0);
                                          ^^^^^^^^^

This is necessary because Link[] is an array of value types.

mono_array_get () is still possible, but it would copy
the element:

DataLink not_a_referece = mono_array_get(retLinks, DataLink, 0);

Robert



More information about the Mono-list mailing list