[Mono-bugs] [Bug 64231][Nor] Changed - [Embedding Mono] Accessing fields of structs
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 30 Aug 2004 20:05:35 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=64231
--- shadow/64231 2004-08-30 19:49:14.000000000 -0400
+++ shadow/64231.tmp.11924 2004-08-30 20:05:35.000000000 -0400
@@ -74,6 +74,30 @@
------- Additional Comments From priewasser@gmx.at 2004-08-30 19:49 -------
If this isn't a bug, shouldn't there be a posibility to access the
public fields of a struct, if [StructLayout (LayoutKind.Sequential)]
isn't set, anyway?
Or is there a posibility to use mono_object_unbox without LayoutKind.
Sequential?
+
+------- Additional Comments From bmaurer@users.sf.net 2004-08-30 20:05 -------
+/* accessors for fields and properties */
+void
+mono_field_set_value (MonoObject *obj, MonoClassField *field, void
+*value);
+
+void
+mono_field_static_set_value (MonoVTable *vt, MonoClassField *field,
+void *value);
+
+void
+mono_field_get_value (MonoObject *obj, MonoClassField *field, void
+*value);
+
+void
+mono_field_static_get_value (MonoVTable *vt, MonoClassField *field,
+void *value);
+
+[in object.h]
+
+NB: if you want to access fields from unmanaged, using a sequential
+type is the best way to do it. That way you can access stuff with ->
+in C, which is much cleaner than method calls.