--- /dev/null
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoEmbedded", "MonoEmbedded\MonoEmbedded.csproj", "{0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}.Debug|x86.ActiveCfg = Debug|x86
+ {0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}.Debug|x86.Build.0 = Debug|x86
+ {0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}.Release|x86.ActiveCfg = Release|x86
+ {0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = MonoEmbedded\MonoEmbedded.csproj
+ EndGlobalSection
+EndGlobal
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0EB75D00-2FC6-4B53-A24D-D982CAC42EA7}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>MonoEmbedded</RootNamespace>
+ <AssemblyName>MonoEmbedded</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
--- /dev/null
+using System;
+using System.Runtime.CompilerServices;
+
+namespace MonoEmbedded
+{
+ class MainClass
+ {
+ public static void Main(string[] args)
+ {
+ Print("characters like \u00D6 are working? (should be an O with ¨ above it)");
+ Print("More characters: ÜÖüöÇç)");
+ }
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ public static extern void Print(string msg);
+ }
+}
--- /dev/null
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+[assembly: AssemblyTitle ("MonoEmbedded")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("gmm003es")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+[assembly: AssemblyVersion ("1.0.*")]
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+
--- /dev/null
+all: test
+
+test: test.c
+ g++ -Wall -g -o test test.c `pkg-config --cflags --libs /usr/mymono/lib/pkgconfig/monosgen-2.pc`
+
+clean:
+ rm -f test
+
--- /dev/null
+#include <stdlib.h>
+#include <iostream>
+#include <mono/jit/jit.h>
+#include <mono/metadata/assembly.h>
+#include <mono/metadata/mono-config.h>
+
+/**
+ * Method to be used from Mono.
+ */
+static inline void p_Print(MonoString *str) {
+ std::cout << "UTF8: " << mono_string_to_utf8(str) << std::endl;
+ std::wcout << "UTF16: " << ((wchar_t*)mono_string_to_utf16(str)) << std::endl;
+}
+
+/**
+ * This program must be run like this: ./test MonoEmbedded.exe
+ * (it requires one argument, even when it is not going to be used because I do not know what
+ * parameters to use in mono_jit_exec method, it crashes with NULL value :/)
+ */
+int main (int argc, char *argv[])
+{
+ /*
+ * Load the default Mono configuration file, this is needed
+ * if you are planning on using the dllmaps defined on the
+ * system configuration
+ */
+ mono_config_parse (NULL);
+
+ /*
+ * mono_jit_init() creates a domain: each assembly is
+ * loaded and run in a MonoDomain.
+ */
+ MonoDomain *domain = mono_jit_init ("../MonoEmbedded/bin/Debug/MonoEmbedded.exe");
+
+ /*
+ * Optionally, add an internal call that your startup.exe
+ * code can call, this will bridge startup.exe to Mono
+ */
+ mono_add_internal_call ("MonoEmbedded.MainClass::Print", (void *)p_Print);
+
+ /*
+ * Open the executable, and run the Main method declared
+ * in the executable
+ */
+ MonoAssembly *assembly = mono_domain_assembly_open (domain, "../MonoEmbedded/bin/Debug/MonoEmbedded.exe");
+ if (!assembly) {
+ exit (2);
+ }
+
+ /*
+ * mono_jit_exec() will run the Main() method in the assembly.
+ * The return value needs to be looked up from
+ * System.Environment.ExitCode.
+ */
+ mono_jit_exec (domain, assembly, argc - 1, argv + 1);
+
+ return 0;
+}