Re: Alternatives to InvokeMethod
From: Ringo (anonymous_at_discussions.microsoft.com)
Date: 04/03/04
- Next message: Gary Milton: "Re: Keeping application alive starting from Sub Main()"
- Previous message: Newbee: "Access TextBox.Text inside a Dynamically Created Table"
- In reply to: Armin Zingler: "Re: Alternatives to InvokeMethod"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 3 Apr 2004 06:19:18 -0800
Thanks, Armin
unfortunately, the objects can have any method name and
the component will only know which methods to call from a
text file. I can't recompile this component to add new
interfaces and the objects being passed to it will always
have there own set of methods.
>-----Original Message-----
>"Ringo" <anonymous@discussions.microsoft.com> schrieb
>> I've created a component that takes a class as an input
>> and executes methods on the class based on a set of
text
>> instructions. The instructions are the names of the
>> methods to be executed and are different for each class
>> passed in. I've been using InvokeMethod to do this and
it
>> works, but, it's TOO slow.
>>
>> I've used the "eval" method in Jscript to do this sort
of
>> thing and it doesn't seem to be as slow.
>>
>> I'm about to try dynamic compilation but it seems
quite a
>> bit more work (and is more likely to develop bugs).
>>
>> I'd appreciate any ideas to solve this problem.
>
>
>If possible, the component, or the library containing
the component, can
>define an interface that must be implemented in the
class passed to the
>component. This requires select case blocks within the
component to call the
>appropriate method depending on the instructions, but I
think it should be
>faster than reflection.
>
>
>--
>Armin
>
>How to quote and why:
>http://www.plig.net/nnq/nquote.html
>http://www.netmeister.org/news/learn2quote.html
>
>.
>
- Next message: Gary Milton: "Re: Keeping application alive starting from Sub Main()"
- Previous message: Newbee: "Access TextBox.Text inside a Dynamically Created Table"
- In reply to: Armin Zingler: "Re: Alternatives to InvokeMethod"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|