[Mono-dev] MonoVTable undefined

Thomas Grill gr at grrrr.org
Tue Mar 7 08:35:12 EST 2006


oops, sorry for the noise - there's still

MonoDomain* mono_object_get_domain      (MonoObject *obj);
MonoClass* mono_object_get_class       (MonoObject *obj);

all the best,
Thomas

Thomas Grill schrieb:
> 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?
>
> best greetings,
> Thomas
>

-- 
Thomas Grill
http://grrrr.org





More information about the Mono-devel-list mailing list