NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

10.3.5 Reference parameter passing

In general, an argument passed to a reference parameter denotes the actual storage location of the argument. However, Visual Basic 7.0 in several cases will use copy-in/copy-out semantics to permit passing arguments to reference parameters when the types do not exactly match or the argument has no storage location. Copy-in/copy-out semantics are accomplished by coercing the value to the parameter type, storing the value to a temporary of the appropriate type and passing a reference to the temporary. On the return from the method, the value in the temporary is coerced back to the type of the original value and stored in the original location.

The three cases when copy-in/copy-out is used are:

  1. If the argument is a property. If there is no setter, then no copy-out is done.
  2. If the argument's type is not the same as the parameter type, but is implicitly convertible to and from it. Note that the value is never copied out if the argument is a value or read-only data member. An implication of this is that any type may be passed to a reference parameter of type Object.
  3. If the call is being made late-bound.