﻿<?xml version="1.0" encoding="utf-8"?><Type Name="VariantWrapper" FullName="System.Runtime.InteropServices.VariantWrapper"><TypeSignature Language="C#" Value="public sealed class VariantWrapper" /><TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit VariantWrapper extends System.Object" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>System.Object</BaseTypeName></Base><Interfaces /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The purpose of <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> is to add one level of indirection when marshaling a managed type to the corresponding VARIANT type.</para><para>You can use this class to wrap an <see cref="T:System.Object" /> that the interop marshaler passes as VT_VARIANT | VT_BYREF. In versions 1.0 and 1.1 of the .NET Framework, it was not possible to marshal variant data of type VT_VARIANT | VT_BYREF to unmanaged code. The interop marshaler passed a variant of the managed type (for example, VT_BSTR | VT_BYREF for <see cref="T:System.String" />, or VT_I4 | VT_BYREF for <see cref="T:System.Int32" />), but not VT_VARIANT | VT_BYREF.</para><para>One advantage of using VT_VARIANT | VT_BYREF variant types is that the type of data can be changed during a method call. For example, you can pass a VT_VARIANT | VT_BYREF variant type that contains a VT_BSTR and get a variant returned that contains a VT_I4 after a method call. Because the COM interop marshaler has no way of knowing when to pass VT_BSTR | VT_BYREF and when to pass VT_VARIANT | VT_BYREF, which points to a variant that contains a BSTR for parameters declared as VARIANT *, you can instruct the marshaler by using <see cref="T:System.Runtime.InteropServices.VariantWrapper" />.</para><para>Note that early binding is not supported; you can use <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> only when calling <see cref="M:System.Type.InvokeMember(System.String,System.Reflection.BindingFlags,System.Reflection.Binder,System.Object,System.Object[],System.Reflection.ParameterModifier[],System.Globalization.CultureInfo,System.String[])" /> or with a Dispatch-only interface called in an early bound fashion. In C#, you must also use the ref keyword to specify ByRef semantics for any parameter of type <see cref="T:System.Runtime.InteropServices.VariantWrapper" />. In Visual Basic, ByRef semantics are added automatically for every implicit late binding call. Also note that nesting <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> objects and arrays of <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> objects is not supported.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Marshals data of type VT_VARIANT | VT_BYREF from managed to unmanaged code. This class cannot be inherited.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public VariantWrapper (object obj);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(object obj) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><Parameters><Parameter Name="obj" Type="System.Object" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> class for the specified <see cref="T:System.Object" /> parameter.</para></summary><param name="obj"><attribution license="cc4" from="Microsoft" modified="false" />The object to marshal. </param></Docs><AssemblyVersion>2.0.0.0</AssemblyVersion></Member><Member MemberName="WrappedObject"><MemberSignature Language="C#" Value="public object WrappedObject { get; }" /><MemberSignature Language="ILAsm" Value=".property instance object WrappedObject" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Object</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the object wrapped by the <see cref="T:System.Runtime.InteropServices.VariantWrapper" /> object.</para></summary></Docs><AssemblyVersion>2.0.0.0</AssemblyVersion></Member></Members></Type>