Thomas Grill wrote:
Hi all,
sorry if this is obvious, but it isn't for me....
The mono/metadata/object.h header file has two convenient macros that i'd like to use

#define mono_object_class(obj) (((MonoObject*)(obj))->vtable->klass)
#define mono_object_domain(obj) (((MonoObject*)(obj))->vtable->domain)

Unfortunately ((MonoObject*)(obj))->vtable points to a MonoVTable structure which is undefined in the public headers. It is actually defined in the class-internals.h header, which is obviously internal.

How would i get the class from an object, other than hackily using the knowledge that klass is the first data member of the undefined vtable?

metadata/object.h:

mono_object_get_class ()
mono_object_get_domain ()

Robert

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to