IMethodReturnMessage::OutArgs Property
Returns the specified argument marked as a ref or an out parameter.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: array<System::Object^>^The specified argument marked as a ref or an out parameter.
| Exception | Condition |
|---|---|
| SecurityException | The immediate caller makes the call through a reference to the interface and does not have infrastructure permission. |
Although the OutArgs property is redundant since the same functionality can be achieved through the OutArgCount field and GetOutArg method, there might be performance optimization available if the implementer understands when all the arguments will be retrieved.
Warning |
|---|
If Exception is not null, a System::IndexOutOfRangeException exception is thrown when OutArgs is accessed. |
virtual IMessage^ Invoke( IMessage^ myMessage ) override { IMethodCallMessage^ myCallMessage = (IMethodCallMessage^)( myMessage ); IMethodReturnMessage^ myIMethodReturnMessage = RemotingServices::ExecuteMessage( myMarshalByRefObject, myCallMessage ); Console::WriteLine( "Method name : {0}", myIMethodReturnMessage->MethodName ); Console::WriteLine( "The return value is : {0}", myIMethodReturnMessage->ReturnValue ); // Get number of 'ref' and 'out' parameters. int myArgOutCount = myIMethodReturnMessage->OutArgCount; Console::WriteLine( "The number of 'ref', 'out' parameters are : {0}", myIMethodReturnMessage->OutArgCount ); // Gets name and values of 'ref' and 'out' parameters. for ( int i = 0; i < myArgOutCount; i++ ) { Console::WriteLine( "Name of argument {0} is '{1}'.", i, myIMethodReturnMessage->GetOutArgName( i ) ); Console::WriteLine( "Value of argument {0} is '{1}'.", i, myIMethodReturnMessage->GetOutArg( i ) ); } Console::WriteLine(); array<Object^>^myObjectArray = myIMethodReturnMessage->OutArgs; for ( int i = 0; i < myObjectArray->Length; i++ ) Console::WriteLine( "Value of argument {0} is '{1}' in OutArgs", i, myObjectArray[ i ] ); return myIMethodReturnMessage; }
for operating with infrastructure code. Demand value: SecurityAction::LinkDemand; Permission value: SecurityPermissionFlag::Infrastructure
Available since 1.1
