I am trying to do something that I am pretty sure will work, but I cannot get over one hurdle...
I have a StringCollection of strings representing Classes. What I want to do is iterate over them, find the class each one names, and then invoke a shared function on that class.
I have been trying something like:
Dim bo As Type
bo = Type.GetType(stringName)
bo.invokeMember("sharedFunctionName", Reflection.BindingFlags.FlattenHierarchy, Nothing, Nothing, Nothing)
The problem with the code is the Type.GetType throws an error that it cannot find a class with the name I specify, which exists in the same project).
Secondly, if I overcome that hurdle, I do not understand the 4th param in the invokeMember function, which is the "target". Can someone please explain that to me? Isn't the target in this case bo, the object I am sending the invokeMember message to?