[Mono-list] MonoObject of type System.Type to MonoClass (C)

Robert Jordan robertj at gmx.net
Fri Dec 15 09:22:11 EST 2006

Paolo Molaro wrote:
> On 12/15/06 Maciej Piechotka wrote:
>> I have a collection which I got from dll. However I have a objects of
>> System.Type and I want to have MonoClass.
>> How can I do it?
> In C# code do:
> 	IntPtr value = type.TypeHandle.Value;
> value is a MonoType* and you can call mono_class_from_mono_type (value)
> to get a MonoClass*.
> Poking into MonoReflectionType* is going to break.

This requires either 2 mono_runtime_invoke calls on the MonoObject* of
the certain System.Type or some managed glue.

It would be nice to have an accessor for the MonoReflectionType->type
member instead.


More information about the Mono-list mailing list