I'm trying to interface with a C++ app. I have everyone tlking to each other but the data that I am sending from VB seems to be byval versus byref.

From the ProbeValue_click event I am calling the C++ interface with sVal = 1.5. I can step through the code and see the 1.5 value when I reach the C++ function. I can also watch the value change to 3.444 in the C++ code.

The intent is to call byRef so the the value in VB equals the value set by C++. The ^ character in C++ (VS8) is the same as the old C/C++ reference character *. So, from what i can tell C++ is expecting a reference but VB is send a value.

What am I missing?

vb Code:
  1. Private Sub BtnProbeValue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProbeValue.Click
  2.     Dim sVar, sVal, sError As String
  3.     Dim sts As Integer
  4.  
  5.     sVar = "Hoppy"
  6.     sVal = 1.5
  7.     sts = SimIFace.ProbeGetValue(sVar, sVal, sError)
  8.  
  9.   End Sub

Code:
int SimIFaceNET::ProbeGetValue(String^ sVar, String^ sVal, String^ sError)
{
  sVal = "3.444";
  sError = sError->Empty;
  return -1;
}