<blockquote><dt><i>method:</i></dt><dd> method to invoke</dd><dt><i>obJ:</i></dt><dd> object instance</dd><dt><i>params:</i></dt><dd> arguments to the method</dd><dt><i>exc:</i></dt><dd> exception information.</dd></blockquote>
<b>Remarks</b>
<p/>
Invokes the method represented by <i>method</i> on the object <i>obj</i>.
obj is the 'this' pointer, it should be NULL for static
methods, a MonoObject* for object instances and a pointer to
the value type for value types.
The params array contains the arguments to the method with the
same convention: MonoObject* pointers for object instances and
pointers to the value type otherwise.
<p/>
From unmanaged code you'll usually use the
mono_runtime_invoke() variant.
Note that this function doesn't handle virtual methods for
you, it will exec the exact method you pass: we still need to
expose a function to lookup the derived class implementation
of a virtual method (there are examples of this in the code,
though).
<p/>
You can pass NULL as the exc argument if you don't want to
catch exceptions, otherwise, *exc will be set to the exception
thrown, if any. if an exception is thrown, you can't use the
MonoObject* result from the function.
<p/>
If the method returns a value type, it is boxed in an object
reference.
If you want to invoke generic methods, you must call the method on the
"inflated" class, which you can obtain from the
<tt>mono_object_get_class()</tt>
<divclass="code">
MonoClass *clazz;
MonoMethod *method;
clazz = mono_object_get_class (obj);
/*
* If there are more Add methods declared, you
* may use mono_method_desc_search_in_class (clazz, ":Add(T)"),
* you must substitute ":Add(T)" with the correct type, for example
* for List<int>, you would use ":Add(int)".
<blockquote><dt><i>method:</i></dt><dd> method to invoke</dd><dt><i>obJ:</i></dt><dd> object instance</dd><dt><i>params:</i></dt><dd> arguments to the method</dd><dt><i>exc:</i></dt><dd> exception information.</dd></blockquote>
<b>Remarks</b>
<p/>
Invokes the method represented by <i>method</i> on the object <i>obj</i>.
obj is the 'this' pointer, it should be NULL for static
methods, a MonoObject* for object instances and a pointer to
the value type for value types.
The params array contains the arguments to the method with the
same convention: MonoObject* pointers for object instances and
pointers to the value type otherwise. The _invoke_array
variant takes a C# object[] as the params argument (MonoArray
*params): in this case the value types are boxed inside the
respective reference representation.
<p/>
From unmanaged code you'll usually use the
mono_runtime_invoke() variant.
Note that this function doesn't handle virtual methods for
you, it will exec the exact method you pass: we still need to
expose a function to lookup the derived class implementation
of a virtual method (there are examples of this in the code,
though).
<p/>
You can pass NULL as the exc argument if you don't want to
catch exceptions, otherwise, *exc will be set to the exception
thrown, if any. if an exception is thrown, you can't use the
MonoObject* result from the function.
<p/>
If the method returns a value type, it is boxed in an object
<blockquote><dt><i>delegate:</i></dt><dd> pointer to a delegate object.</dd><dt><i>params:</i></dt><dd> parameters for the delegate.</dd><dt><i>exc:</i></dt><dd> Pointer to the exception result.</dd></blockquote>
<b>Remarks</b>
<p/>
Invokes the delegate method <i>delegate</i> with the parameters provided.
You can pass NULL as the exc argument if you don't want to
catch exceptions, otherwise, *exc will be set to the exception
thrown, if any. if an exception is thrown, you can't use the
<blockquote><dt><i>name:</i></dt><dd> the method name.</dd><dt><i>include_namespace:</i></dt><dd> whether the name includes a namespace or not.</dd></blockquote>
<b>Returns</b>
<blockquote> a parsed representation of the method description.
</blockquote>
<b>Remarks</b>
<p/>
Creates a method description for <i>name</i>, which conforms to the following
specification:
[namespace.]classname:methodname[(args...)]
in all the loaded assemblies.
Both classname and methodname can contain '*' which matches anything.