![]() |
| ||
| Reflection Invoke Method w/ Params Hi All, A long time ago I researched Reflection and created a solution demoing my learnt capabilities from it. In my example I did not pass any arguments into the Invocation of the method call using reflection. I went to tackle this and I seem to be hitting a few dead ends. Here is the method I call from my Main method in another class. public void RunClass(string dllName, string className, string methodName, params Object[] parameters) I call this RunClass method from my Main method like this: //_UserInputParam is a Console.ReadLine() object (In my testing I am passing '5' to this call). The class that is being called by the invocation of the reflection method call is set up like this: public void DisplayMyself(params Object[] parameters) The error I'm receiving is: Object reference not set to instance of an object. It occurs on the line And it occurs on the line: _MethodInfo.Invoke(_InvokeParam1, new Object[] { parameters });Even though when debugging parameters, it has the object '5' within it (or whatever the user inputs into the console.readline (and outputted through int32.parse() call). Any help/insight would be appreciated. Thanks, -Catch |
| ||
| Re: Reflection Invoke Method w/ Params Hey man, I am having the same issue, if youknow of a solution let me know, otherwise i'll keep searching and let you know if I do :) |
| ||
| Re: Reflection Invoke Method w/ Params Please, send me your project on RamyMahrous@gmail.com I'll debug it and tell you the problem en shaa ALLAH |
| ||
| Re: Reflection Invoke Method w/ Params I've been working with c# since only a year, but I figured this for a c# windows service I've made that calls a vb6 class object with no less then 52 arguments.... hope it will help someone. using System; Let me know if it's clear enough... Thanks. |
| All times are GMT -4. The time now is 10:30 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC