Interoperability issue between VC++ (ocx) & VB.NET applications
<p>We are migrating a product from VB6 to VB.NET and facing an issue. 
This product interacts with a function defined in VC++ component (.ocx).</p>

<ol>
<li><p>VB6 &amp; VB.NET function call:</p>

<p>result = TestFunc(Param1, Param2, Param3)</p></li>
<li><p>VC++:
a) Function definition in .CPP file:
   long TestFunc(long FAR* Param1, const VARIANT FAR&amp; Param2, long Param3) 
    {
    ...
    }</p></li>
</ol>

<p>DISP_FUNCTION(Ctrl, "TestFunc", TestFunc, VT_I4, VTS_PI4 VTS_VARIANT VTS_I4)</p>

<p>b) Function signature in .ODL file:
      long TestFunc(long* Param1, VARIANT Param2, long Param3);</p>

<p>c) Function signature in .h(header) file:
      afx_msg long TestFunc(long FAR* Param1,  const VARIANT FAR&amp; Param2, long Param3);</p>

<p>"Param2" in above "TestFunc" is defined as byte array in VB6 &amp; VB.NET.</p>

<p>In VC++, the corresponding type for "Param2" in "TestFunc" is - "const VARIANT FAR&amp; Param2".</p>

<p>In VB6, the byte array values passed gets modified in VC++ "TestFunc" &amp; the modified values are received in VB6 "Param2" variable.</p>

<p>Issue in VB.NET:</p>

<p>In VB.NET, the byte array values passed gets modified in VC++ "TestFunc".
However, the modified values are not transferred from VC++ to VB.NET. The "Param2" variable still has the original values &amp; not the modified values.</p>

<p>Could you please provide us information on how to obtain the modified byte array values in VB.NET from the Variant variable in VC++ component?</p>

<p>Thanks in advance.</p>