J
JimM
how do you set property using Activator.CreateInstance?
Dim ty As Type = Type.GetTypeFromProgID("Project1.Class1")
Dim o As Object = System.Activator.CreateInstance(ty)
Dim pi As PropertyInfo = ty.GetProperty("Test")
Dim params() As Object = {1S}
pi.SetValue(o, "Test", params) <---- failed here
it failed the last line "Object reference not set to an instance of an
object". Please advice.
Dim ty As Type = Type.GetTypeFromProgID("Project1.Class1")
Dim o As Object = System.Activator.CreateInstance(ty)
Dim pi As PropertyInfo = ty.GetProperty("Test")
Dim params() As Object = {1S}
pi.SetValue(o, "Test", params) <---- failed here
it failed the last line "Object reference not set to an instance of an
object". Please advice.