It would be better if all the objects passed in implemented the same
interface and the modal form called a known method. Any params can be
stored within the object instance ahead of time or passed as a generic
object array.
Another way to handle this is to use delegates.. pass a delegate to
the form allong with an object array of params, and the form can
invoke the delegate. This would work fine but in my opinion the
interface method is a cleaner implementation.
CallByName uses late binding and reflection internally and has a lot
of overhead that isn't necessary for the task.
HTH,
Sam
On Fri, 7 Jan 2005 10:13:02 -0800, "Rob R. Ainscough"
<ro*****@pacbell.net> wrote:
I use a generic Processing form (modal) where I pass it an object and method
name and parameters if needed and then use CallbyName to execute the passed
in method. What this does for me is lock out user input on the parent form
as the Processing form has no input controls until all processing is
complete.
I was curious if CallByName is a good way to perform this operation?