I'm having problems attempting to pass parameters that are gathered from various sources (XML, Database, etc). I have created an object array of the necessary parameters but i keep getting this error when trying to call the invoke option.
Object reference not set to an instance of an object.
It tells me to create a new instance of the object. I'm getting confused as I've stared at these lines of code for way too long.
Dim _params As New Object
_params = parse_instructions(instructions(current_process).Split(","))
'Set up the reflection call
Dim objClass As Comms = Current_IOUnit.Current_Port
Dim method As MethodInfo = objClass.GetType().GetMethod(current_process)
'Call the function and save the value
Return method.Invoke(objClass, _params)