RE: Method Invoke problem (FIXED)

2010-06-18 Thread Greg Keogh
The object[] objs array is indicating that the method expects three parameters, rather than a single parameter which is an array. You need an array that contains one array :) D'oh! You're right. I was thinking one-dimensionally. This has fixed it: mi.Invoke(this, new object[] { objs }); An Array

Re: Method Invoke problem

2010-06-18 Thread Joseph Clark
The object[] objs array is indicating that the method expects three parameters, rather than a single parameter which is an array. You need an array that contains one array :) object[] objs = new object[] { new object[] {"Hi", 123, DateTime.Now}}; PS. Who feeds the magpies?! My dad shoots them

Method Invoke problem

2010-06-18 Thread Greg Keogh
Folks, the following skeleton code dies on the Invoke with a TargetParameterCountException. The code is all in the same class. MethodInfo mi = this.GetType().GetMethod("TestMethod", BindingFlags.Instance|BindingFlags.NonPublic); object[] objs = new object[] { "Hi", 123, DateTime.Now };