ok I do have class like this.
Namespace mySpace
Public Class ClassA
Private Function MethodA(prm AS Boolean) As Boolean
Return False
End Function
Private Function MethodB() As Boolean
Return False
End Function
End Class
Public Class ClassB
Private Function MethodC() As Boolean
Return True
End Function
Private Function InvokeA() As Boolean
Dim methodObj As MethodInfo
'null pointer except below here
methodObj = Type.GetType("mySpace.ClassA").GetMethod("MethodA")
Dim params As Boolean() = {False}
Return CBool(methodObj.Invoke(New ClassA(), params))
End Function
End Class
End Namespace
What I am trying here is to invoke a method from a different class with parameters using its method. But this returns a null pointer exception. Why? Where I went wrong?