Hi,
I'd be grateful for some help...
I'm trying to create a late bound object using:
Activator.Creat eInstance(Type, ConstructorPara meters())
The constructor of the object takes a delegate as the only parameter.
However, ConstructorPara meters() is an object array and because a
Delegate is not derived from System.Object, it won't compile.
Here's an example of what I'm trying to achieve:
Dim t As Type = Type.GetType("N amespace.ClassN ame,AssemblyNam e")
Dim p() as Object = {AddressOf DelegatedMethod }
Dim o As IObject = DirectCast(Acti vator.CreateIns tance(t, p), IObject)
Is there a work around to this?
TIA for any help.
Regards
John.
I'd be grateful for some help...
I'm trying to create a late bound object using:
Activator.Creat eInstance(Type, ConstructorPara meters())
The constructor of the object takes a delegate as the only parameter.
However, ConstructorPara meters() is an object array and because a
Delegate is not derived from System.Object, it won't compile.
Here's an example of what I'm trying to achieve:
Dim t As Type = Type.GetType("N amespace.ClassN ame,AssemblyNam e")
Dim p() as Object = {AddressOf DelegatedMethod }
Dim o As IObject = DirectCast(Acti vator.CreateIns tance(t, p), IObject)
Is there a work around to this?
TIA for any help.
Regards
John.
Comment