[Mono-dev] Invoking .net interface method from c api

Robert Jordan robertj at gmx.net
Wed Aug 19 09:43:20 UTC 2015


On 19.08.2015 08:39, zebrajap wrote:
>
> This code fails at MonoObject* pIcc =
> mono_runtime_invoke(pMethodCreateCompiler, pCodeProvider, NULL, NULL); line.
> What am I doing wrong.
>


You're supposed to call mono_object_get_virtual_method () on the
interface method prior to invoking it on a derived class:

pMethodCreateCompiler = mono_object_get_virtual_method(pCodeProvider,
   pMethodCreateCompiler);
mono_runtime_invoke(pMethodCreateCompiler, pCodeProvider, NULL, NULL);



Robert




More information about the Mono-devel-list mailing list