Bryce Gough
Active member
Hey Guys,
Pretty much what I have is many many classes created, now the user will type a class name and a method and the application will run that method with the supplied arguments. Now I have got it working using:
But I cannot find out how to create an instance of the class from a string.
'"Code." & Import' is that full class name that I want to create as I have used it in Type.GetType, but that is just getting the method from the class and I need to create an instance of the class to invoke that method.
Never mind guys, I've fixed it!
I used:
and it seemed to work fine
Thanks,
Bryce Gough
Pretty much what I have is many many classes created, now the user will type a class name and a method and the application will run that method with the supplied arguments. Now I have got it working using:
Dim method As System.Reflection.MethodInfo method = Type.GetType("Code." & Import).GetMethod(MethodName) method.Invoke(<New Instance Of Class>, Arguments)
But I cannot find out how to create an instance of the class from a string.
'"Code." & Import' is that full class name that I want to create as I have used it in Type.GetType, but that is just getting the method from the class and I need to create an instance of the class to invoke that method.
Never mind guys, I've fixed it!
I used:
Assembly.GetExecutingAssembly().CreateInstance("Code." & Import)
and it seemed to work fine
Thanks,
Bryce Gough
Last edited: