Calling a Method Using Reflection

  • Thread starter Thread starter Vikram
  • Start date Start date
V

Vikram

Hi,

How do I call a method which takes a ref parameter using Reflection ??

Thanks,
Vikram
 
Vikram,
How do I call a method which takes a ref parameter using Reflection ??

The same way you call methods without ref parameters. Do you have any
problems with it?



Mattias
 
Vikram said:
How do I call a method which takes a ref parameter using Reflection ??

There's a good example in MSDN under
Type.InvokeMember Method
(String, BindingFlags, Binder, Object, Object[])

The constructor there is called with a ref parameter. Basically, the
value in the parameter array is replaced with the final value, if you
see what I mean.
 
Hi,

Forgot to mention. The method is overloaded.
Can u point me to a sample for calling overloaded methods and with the
method having a ref or out
parameter.

Thanks,
Vikram


Jon Skeet said:
Vikram said:
How do I call a method which takes a ref parameter using Reflection ??

There's a good example in MSDN under
Type.InvokeMember Method
(String, BindingFlags, Binder, Object, Object[])

The constructor there is called with a ref parameter. Basically, the
value in the parameter array is replaced with the final value, if you
see what I mean.
 
Vikram said:
Forgot to mention. The method is overloaded.
Can u point me to a sample for calling overloaded methods and with the
method having a ref or out parameter.

The method being overloaded makes no difference when you *call* it - it
just means that you need to be careful when supplying the parameter
types to Type.GetMethod.
 
Back
Top