Hi,
I have a dll file, and i took an object from it and called the functions inside this dll by the object, like this way:
Command testClass = (Command)assembly.CreateInstance(creatObject);
testClass.Execute();
anyway, the i used reflection from some reason. so i need to use invoke function & set values for variables, then calling the basic function Execute.
Before: i wrote the following:
object returnValue = objectType.GetMethod("setValues").Invoke(classObject, arguments);
testClass.Execute();
but it wasnt useful for me.
i used the following:
object returnValue = objectType.GetMethod("setValues").Invoke(classObject, arguments);
object returnValue1 = objectType.GetMethod("Execute").Invoke(classObject, null);
i just want to ask if this is right, to calling the execute in this way, and by the way it works!
Thank you.