mono-embedding

add Mono internal call where a string is passed by reference

守給你的承諾、 提交于 2021-02-08 09:38:13
问题 I'm trying to create a method using mono where a string is passed by reference, here is the test code I have: C++: static bool p_TestMethod(int num, MonoString ** response) { auto b = mono_string_new(mono_domain_get(), "Test repsonse"); response = &b; return true; } //... mono_add_internal_call("SharpCode.TestClass::Testmethod", p_TestMethod); C#: [MethodImpl(MethodImplOptions.InternalCall)] public static extern bool Testmethod(int num, out string response); public bool RunTheTest() { string

Running 32-bit version of Mono Embedded

邮差的信 提交于 2020-01-06 05:41:08
问题 When running a C# program using Mono and you want to use 32-bit version, you just use mono --arch=32 , but how can you do it when using Embedded Mono? I couldn't find any dedicated function in official documentation, and char* options[1]; options[0] = (char*)malloc(50 * sizeof(char)); strcpy(options[0], "--arch=32"); mono_jit_parse_options(1, (char**)options); results in Mono shutting down with Unsupported command line option: '--arch=32' 来源: https://stackoverflow.com/questions/47016012

Debugging C# assembly launched by embedded mono runtime?

删除回忆录丶 提交于 2020-01-01 03:30:06
问题 I am talking about a small game engine using C# for game programming. So, I have a C++ app embedding mono runtime (I call it 'launcher'). And I have an assembly written in C# which is my game engine class library. The launcher launches the assembly as it is suggested in Embedding Mono. And now the interesting part! The launcher implements in C++ miscelaneous functions which are exposed to the mono runtime as internal methods of my game engine classes. That is why my game engine assembly is

Passing arguments from C to Embedded Mono

旧时模样 提交于 2019-12-11 15:24:50
问题 I am trying to invoke a simple C# class method from C, using embedded mono (as described here). I can invoke the method, but the C# function receives 0 as the argument, instead of the number I pass in. The C# function returns a result and the C code is seeing the correct result - I just can't pass arguments in. What am I doing wrong? The C# assembly (MonoSide.cs) is: using System; public class MainEntryPoint { static public void Main(string[] args) { } } namespace Fibonacci { public class

Embedding: mono vs lua

强颜欢笑 提交于 2019-12-03 08:26:43
问题 I am interested in hearing about peoples experience with embedding mono (open source implementation of .NET) in a C/C++ application. How is it to distribute such an application and what are the dependencies? I have tested on OS X and mono comes as a huge framework (hundreds of MB). Do users of my app all need this big framework or can it be stripped down or everything be compiled into the main executable. I previously have experience with embedding Lua in a C++ app, and that works really well

Embedding: mono vs lua

蹲街弑〆低调 提交于 2019-12-02 21:02:37
I am interested in hearing about peoples experience with embedding mono (open source implementation of .NET) in a C/C++ application. How is it to distribute such an application and what are the dependencies? I have tested on OS X and mono comes as a huge framework (hundreds of MB). Do users of my app all need this big framework or can it be stripped down or everything be compiled into the main executable. I previously have experience with embedding Lua in a C++ app, and that works really well because I can link statically the whole lua interpreter in with my main executable. So I have no