// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class MainClass { public static void Main(string[] args) { Console.WriteLine("COM/C# dynamic"); dynamic test = Activator.CreateInstance(Type.GetTypeFromProgID("Test.CoTest")); Console.WriteLine("123 + 456 = {0}", test.Add(123, 456)); Console.WriteLine("ABC + XYZ = {0}", test.Concat("ABC", "XYZ")); Console.WriteLine("IV = {0} SV = {1}", test.IV, test.SV); test.IV = 123; test.SV = "ABC"; Console.WriteLine("IV = {0} SV = {1}", test.IV, test.SV); } }