I am trying to use reflector.InvokeMethod to invoke a function with an optional parameter. The function looks like this:
Private Function DoSomeStuff(ByVal blah1 as string, ByVal blah2 as string, Optional ByVal blah3 as string = "45") as boolean
'stuff
end function
and I'm Invoking it like this:
Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2, Param3)
This works fine, other than when I don't pass the third (optional) parameter, it dosn't hit the function.
Dim result As Boolean = Reflector.InvokeMethod(AccessModifier.private,obj_of_Class, "DoSomeStuff", Param1, Param2)
Is there a way I can use Reflector.invokeMethod to call this function without passing the optional parameter? or another way to achieve this?