Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-15 Thread mugginsoft
Just to give the completed test code: // Obj-C - (MonoObject *)execute { // get a reference to the System.Core assembly MonoAssemblyName *monoAssemblyName = mono_assembly_name_new(System.Core); MonoAssembly *monoSystemCoreAssembly = mono_assembly_loaded(monoAssemblyName);

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-14 Thread jonat...@mugginsoft.com
On 12 Jul 2013, at 21:48, jonat...@mugginsoft.com wrote: Can I obtain the generic template type from my ObjectSet MonoObject pointer rather than having to obtain it from a const char*. I am trying to write a generic routine for calling generic methods. Perhaps another helper method is the

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-12 Thread jonat...@mugginsoft.com
You must inflate the generic method upon invocation. IIRC, there is no function in the embedded API which does this. There is mono_class_inflate_generic_method() but this requires a MonoGenericContext. I am attempting to call the generic method ObjectSet.ToList(). The code below employs

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-12 Thread Robert Jordan
Hi, On 12.07.2013 15:06, jonat...@mugginsoft.com wrote: // invoke the generic helper method MonoObject *monoException = NULL; void *hargs [2]; hargs [0] = methodInfo; hargs [1] = mono_type_get_object(env.monoDomain, genericParameterType); MonoMethod *genericMethod

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-12 Thread jonat...@mugginsoft.com
You have to unbox the result of mono_runtime_invoke because it returns the IntPtr boxed in a MonoObject*. Something like that: MonoObject* obj = mono_runtime_invoke (...) MonoMethod* genericMethod = *(MonoMethod**) mono_object_unbox (obj); The above makes sense but it aborts with:

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-12 Thread Robert Jordan
On 12.07.2013 21:43, jonat...@mugginsoft.com wrote: You have to unbox the result of mono_runtime_invoke because it returns the IntPtr boxed in a MonoObject*. Something like that: MonoObject* obj = mono_runtime_invoke (...) MonoMethod* genericMethod = *(MonoMethod**) mono_object_unbox (obj);

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-12 Thread jonat...@mugginsoft.com
Hi On 12.07.2013 22:25, Robert Jordan wrote: To me, it looks like you want to inflate invoke to ToList on ObjectSetData.Employee which doesn't sound quite right to me. I'm rephrasing this :) It looks like you're inflating ToList with ObjectSetData.Employee instead of Data.Employee.

[Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread mugginsoft
Hi I have a MonoAssembly pointer to System.Core. I obtain a MonoClass pointer to System.Linq.Enumerable with the above assembly. This is a static class used to implement LINQ functionality via extensions. I write the method names to the console. The signature of the the method I want, ToList() is

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread Robert Jordan
On 11.07.2013 13:55, mugginsoft wrote: Hi I have a MonoAssembly pointer to System.Core. I obtain a MonoClass pointer to System.Linq.Enumerable with the above assembly. This is a static class used to implement LINQ functionality via extensions. I write the method names to the console. The

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread mugginsoft
Robert Jordan wrote It works for me using both mono_class_get_method_from_name () and mono_method_desc_search_in_class (). I am still having issues: // get a reference to the System.Core assembly MonoAssemblyName *monoAssemblyName = mono_assembly_name_new(System.Core); MonoAssembly

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread Robert Jordan
On 11.07.2013 15:31, mugginsoft wrote: Robert Jordan wrote It works for me using both mono_class_get_method_from_name () and mono_method_desc_search_in_class (). I am still having issues: // get the method const char *methodName =

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread mugginsoft
Robert Jordan wrote This must be :ToList(System.Collections.Generic.IEnumerable`1) Hmm. This still aborts with me. My setup is OS X 10.8.4 running 32bit Mono 3.0.10 and the v4.0.30319 runtime. Jonathan -- View this message in context:

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread Robert Jordan
On 11.07.2013 15:53, mugginsoft wrote: Robert Jordan wrote This must be :ToList(System.Collections.Generic.IEnumerable`1) Hmm. This still aborts with me. Now I see why: you're using mono_class_get_method_from_name () and this function expects nothing more than the simple method name. Try

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread mugginsoft
Robert Jordan wrote Try mono_class_get_method_from_name (ToList, 1) or create a descriptor from :ToList(System.Collections.Generic.IEnumerable`1). Thanks. mono_class_get_method_from_name (ToList, 1) does resolve. However: My actual implementation is via Dumbarton which uses

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread mugginsoft
Robert Jordan wrote Oops, my test actually passes with: :ToList(System.Collections.Generic.IEnumerable`1 TSource ) Thanks. I thought I had tried all the combinations - I should have been more methodical! I wonder why the method name querying functions provide a different sig? However

Re: [Mono-list] Embedded API: Method signature not found with generic parameter

2013-07-11 Thread Robert Jordan
On 11.07.2013 21:08, mugginsoft wrote: Robert Jordan wrote Oops, my test actually passes with: :ToList(System.Collections.Generic.IEnumerable`1 TSource ) Thanks. I thought I had tried all the combinations - I should have been more methodical! I wonder why the method name querying