G
Guest
I'm having a problem with late binding. I'm able to create an instance of a class dynamically at runtime and set a property, as in the following
EventCollectionFilterType.InvokeMember("EventGUID", BindingFlags.SetProperty, null, oEventCollectionFilter, paramEventGUIDObject)
However, invoking a method using the following doesn't work, with a runtime error being generated, compaining that it cannot find the method
oEvent = EventCollectionType.InvokeMember("Item", BindingFlags.Public | BindingFlags.InvokeMethod, null, oEventCollection, paramItemObject)
I've checked the method, and it has a public modifier, as expected, and is visible when explicitly creating an object of that type in the usual way. What am I doing wrong?
Martin
EventCollectionFilterType.InvokeMember("EventGUID", BindingFlags.SetProperty, null, oEventCollectionFilter, paramEventGUIDObject)
However, invoking a method using the following doesn't work, with a runtime error being generated, compaining that it cannot find the method
oEvent = EventCollectionType.InvokeMember("Item", BindingFlags.Public | BindingFlags.InvokeMethod, null, oEventCollection, paramItemObject)
I've checked the method, and it has a public modifier, as expected, and is visible when explicitly creating an object of that type in the usual way. What am I doing wrong?
Martin