public sub whatever(classname as string)
dim something as new classname
end sub
Thanks
Paul
Private Sub DoSomething(ByVal ClassName As String, ByVal MethodName As String) '-- Establish locals Dim loObject As Object Dim loType As Type Dim loMethod As Reflection.MethodInfo
'-- Get the type loType = Type.GetType(ClassName)
'-- Create the object loObject = Activator.CreateInstance(loType)
'-- Get the method loMethod = loType.GetMethod(MethodName)
'-- Execute the method loMethod.Invoke(loObject, Nothing)End Sub
You can also use the Object Browser in visual studio and look at everything in the System.Reflection namespace. You'll get lots of ideas of what you might want to do
That was what I was looking for! Once I seen it the light came on. Thanks man
Reflection is fun because you can do literally ANYTHING with it... access private members, create instances of private types, etc.; you can even use the stuff within the Emit namespace to create dynamic types, methods, and assemblies. However, you'll want to try to use it as sparingly as possible because it is slow... in fact, it's even slower than late binding, but there are times when it is unavoidable. We go to great lengths within the framework to avoid the use of reflection where ever possible (hence the creation of the property descriptors within the business object... if you don't use them, then .NET uses reflection to accomplish all of the binding tasks).
Reflection seems like macro substitution "&" in foxpro but on steriods.
Now I am struggling with type converters.
You are exactly right here...just a much better strong-typed version that is not as likely to blow your fingers off when you use it
Should I seet and wait then?
Oh, good to know. I will certainly bump into it soon.
Don't think you're allowed to swear in the forum!
You made me laugh Your posts are always enjoyable to read!