Ref Parameters

Feb 28, 2008 at 9:07 PM
Can someone remind me whether we can use simple ref parameters in System.AddIn. I can't seem to find this critical informaiton.

I just want to pass back a string and a token. If I can avoid the overhead of an IContract I'd like to do that.

Feb 29, 2008 at 8:14 PM
You can, but the pipeline builder doesn't currently support this functionality. You can use the CustomPipelineSegment pipeline hint to indicate to it that you want to handle the code for the types that need this functionality. I recomend having the tool build the first pass for these types and then adding in the custom code to support the ref parameter afterwards.

Alternatively, you can use a struct to store the info you want to pass back across and avoid the costs of the reference semantics of an IContract.

Mar 10, 2008 at 8:20 PM
I just wanted to close the loop on this. The latest CTP (March) now adds in support for ref and out parameters so you'll no longer have to manually modify that code.