title: How to initialize Variant pvarVal
body: <p>I have the below code in which I am calling VariantInit method for variant.pvarval, because I am going to store varaint in the another variant called pval. So before storing value into <code>pVal-&gt;pvarVal</code>, I am calling <code>VariantInit</code> for <code>pVal-&gt;pvarVal</code>. But the call <code>VariantInit(pVal-&gt;pvarVal)</code> is crashing. </p>
  
  <pre><code>void Function(VARIANT FAR* pVal)
      { 
  
         VariantInit(pVal);
         VariantInit(pVal-&gt;pvarVal);
  
         pVal-&gt;vt = VT_VARIANT | VT_BYREF ;
  
          __int64 biNewVal =  // Some logic here
          pVal-&gt;pvarVal-&gt;vt = VT_CY;
          pVal-&gt;pvarVal-&gt;cyVal.int64 = biNewVal;
  
      }
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      VARIANT var;    
      Function(&amp;var);
      return 0;
  }
  </code></pre>