// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; using System.Runtime.InteropServices; using System.Text; public class TestMix { public static void Main(string[] args) { int a = 123; int b = 456; int c = Mix.MixAdd(a, b); Console.WriteLine(c); // int[] six = { 1, 2, 3, 4, 5, 6 }; int allsix = Mix.MixSum(six); Console.WriteLine(allsix); // string s = "ABC"; string s2 = Mix.MixDup(s); Console.WriteLine(s2); // int iv; string sv; Mix.MixGetOut(out iv, out sv); Console.WriteLine("{0} {1}", iv, sv); // MgData1 d1 = Mix.MixGetRet(); Console.WriteLine("{0} {1}", d1.iv, d1.sv); // MgData2 d2 = new MgData2(); d2.iv1 = 123; d2.sv1 = "ABC"; Mix.MixChg(out d2); // note out even though it is really ref Console.WriteLine("{0} {1}", d2.iv2, d2.sv2); } }