[Mono-dev] mono_add_internal_call to mscorlib method
alexander.koeplinger at xamarin.com
Thu Jun 9 01:17:42 UTC 2016
You're looking at the wrong implementation of Environment.cs. The one we're
using is still Mono's implementation (as opposed to the MS referencesource
one you're looking at):
It ends up calling into the runtime to
Anyway, this shouldn't matter as you're not supposed to add an icall for
that yourself, it's provided by Mono. From a quick reading of the code
there's no way this can return null so I'm a bit confused, but I'll let the
runtime experts weigh in :)
2016-06-08 21:26 GMT+02:00 nicob <nicolasbotto at gmail.com>:
> Hi, I'm trying to use the Skype Sdk in mono embedded. I'm able to load the
> assemblies but when I try to create a instance of a class that internally
> calls System.Environment.GetCommandLineArgs it throws an exception. After
> digging a bit I found out the System.Environment.GetCommandLineArgs
> internally invokes:
> private static extern string GetCommandLineArgsNative();
> this method is returning null therefore it fails. I'm trying to add an
> internal call to the extern method using:
> mono_add_internal_call ("System.Environment::GetCommandLineArgsNative",
> I also tried:
> but neither of them seem to work as my C++ function is never invoked.
> C++ function:
> MonoArray* GetCommandLine()
> MonoDomain* domain = mono_domain_get();
> MonoArray* array = mono_array_new(domain, mono_get_string_class(), 1);
> MonoString* ret = mono_string_new(domain, "yeah!");
> mono_array_setref(array, 0, ret);
> return array;
> Am I missing something?
> Thanks in advanced.
> View this message in context:
> Sent from the Mono - Dev mailing list archive at Nabble.com.
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list