473,394 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Invoking Method using Reflection

I'm using reflection to invoke some methods,
now the general patteren of the function defination is

private void FunctionName( argument1 , argument2)

for some functions i don't need the argument2 but for some i do...is there
any way using reflection to invoke the method but omit the last argument in
some function definations while for other we use it.
regards,
Beenish Khan
Nov 17 '05 #1
1 2348
Hi,

Are the parameters the same type? I mean is argument1 always the same type
?

When you say that you do not need the second parameter, are you saying that
the method does not require it?
or that you know that the result will be the same no matter what value you
use? if so you should create an overload method ( in case you have access to
the code )
Remember that you have to pass a value to each parameter so even if you do
not use it you need to pass something.

You cannot omit a method, you have to supply a value for each parameter.
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Beenish Sahar Khan" <be**********@kolachi.net> wrote in message
news:ue****************@TK2MSFTNGP12.phx.gbl...
I'm using reflection to invoke some methods,
now the general patteren of the function defination is

private void FunctionName( argument1 , argument2)

for some functions i don't need the argument2 but for some i do...is there
any way using reflection to invoke the method but omit the last argument
in some function definations while for other we use it.
regards,
Beenish Khan

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: djp | last post by:
Hi, I'm trying to access fields that are local to a method using reflection. What BindingFlags value should I use and is this possible at all. So far I was able to retreive class fields only. ...
1
by: djp | last post by:
Hi, I'm trying to access fields that are local to a method using reflection. What BindingFlags value should I use and is this possible at all. So far I was able to retreive class fields only. ...
2
by: Rob | last post by:
I'm using reflection to inspect a class and its methods. Is is possible to determine if the class is a derived class or an interface implementation? I'm using the MethodInfo object for relfection...
2
by: Jeff | last post by:
I am trying to dynamically load an assembly via reflection and then invoke a method of that assembly that will populate a custom type collection passed into the method byref. I am able to...
3
by: cartoper | last post by:
I am currently doing some R&D. The objective is to learn how to invoke methods via reflection using the InvokeMember method. The InvokeMember method throws an exception: Method...
3
by: Rotsey | last post by:
Hi, I am getting a Exception has been thrown by the target of an invocation error when invoking a method Here is the crux of the code. I realise it could be a few things, any one give me...
0
by: pso19 | last post by:
Hi, I am trying to access all the properties, methods of an assembly using reflection. But what i want to do is invoke a method which contains custom parametrs like enumeration defined in a...
4
by: =?Utf-8?B?QWJoaQ==?= | last post by:
I am using Reflection to invoke methods dynamically. I have got a special requirement where I need to pass a value to method by setting the custom method attribute. As I cannot change the...
1
by: Andrus | last post by:
How to call extension method using reflection ? I tried this code but methodInfo is null. Andrus. using System.Reflection; using System.Windows.Forms;
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.