[Mono-list] late linking & dynamic invocation ...
27 Jun 2002 09:42:01 +0100
On Wed, 2002-06-26 at 22:03, Gonzalo Paniagua Javier wrote:
> Not sure about this, but you can use TypeBuilder to hold your stub,
> complete it as you know how it should be (adding methods), then use
> MethodBuilder to add some code to the methods, then you can create an
> instance of the type using:
> Activator.CreateInstance (typeBuilder.CreateType (), null);
> I repeat, not sure about this.
Great - but that seem pretty useless when you can't invoke the method
you want on the object without the prototype / method description being
available at runtime ;-) So yes, one can dynamically create a stub
object - but one can't actually invoke the methods on it without a
horribly pedestrian 'stubObject.Invoke (blah blah ...)' :-)
email@example.com <><, Pseudo Engineer, itinerant idiot