For the archives, the more generic work around for dealing with the fact
that the IMethodCallMessage interface Args property only has a getter that
returns a copy of the args is to wrap an instance of the
MethodCallMessageWrapper class around the existing message.  This class has
a setter for the Args property that lets you tweak individual arguments to
the method.  Once you've tweaked the args, you then pass this wrapper
message along in place of the original method call message.

See here for an example:

http://discuss.develop.com/archives/wa.exe?A2=ind0111E&L=DOTNET&P=R5129&I=-3

(Although note that in demonstrating how to use this class I forgot to
actually store the updated arg ["newspeech" in the post] back into the
wrapper object.  But don't let that take away from the demonstration, though
:-)

-Mike
http://staff.develop.com/woodring
http://www.develop.com/devresources

----- Original Message -----
From: "Sievert, James A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 25, 2002 7:07 AM
Subject: Re: [ADVANCED-DOTNET] Interposer class and problems


> > What's the Correct
> > Way(tm) to call InvokeMember with the RealProxy-derived
> > Interposer so [out] parameters are contained? Thanks
>
> I never noticed it until now, but the .Net Framework implementation of
> IMethodCallMessage.Args actually recalculates/recreates the argument list
> array every time it's called.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to