title: Copying between VARIANT and _variant_t
body: <p>I'm fairly certain that I can safely do:</p>
  
  <pre><code>void funcA(VARIANT &amp;V,_variant_t &amp;vt)
  {
      vt = V;
  }
  </code></pre>
  
  <p>But what about the other way around:</p>
  
  <pre><code>void funcB(VARIANT &amp;V,_variant_t &amp;vt)
  {
      V = vt;
  }
  </code></pre>
  
  <p>I've been seeing some REALLY weird behaviour in my app which I put down to COM-related threading issues. But then I got wondering if I was screwing up memory using variants wrongly. In funcB, the VARIANT V is part of a safe-array being prepared for a COM call. With my V=vt line, am I doing a shallow copy which will break things when the same variant gets deallocated twice?</p>
  
  <p>I really like _variant_t and avoiding all the ::VariantXXX methods, is there a neat way to use _variant_t in funcB to automate the copying?</p>