public static IntPtr ConvertVariantByrefToPtr(ref Variant value)
 {
     return(_ConvertVariantByrefToPtr(ref value));
 }
        public static object GetObjectForVariant(Variant variant)
        {
            IntPtr ptr = UnsafeMethods.ConvertVariantByrefToPtr(ref variant);

            return(System.Runtime.InteropServices.Marshal.GetObjectForNativeVariant(ptr));
        }
 public void SetAsByrefVariant(ref Variant value)
 {
     Debug.Assert(IsEmpty); // The setter can only be called once as VariantClear might be needed otherwise
     VariantType = (VarEnum.VT_VARIANT | VarEnum.VT_BYREF);
     _typeUnion._unionTypes._byref = UnsafeMethods.ConvertVariantByrefToPtr(ref value);
 }