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:
Private Sub BtnProbeValue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnProbeValue.Click Dim sVar, sVal, sError As String Dim sts As Integer sVar = "Hoppy" sVal = 1.5 sts = SimIFace.ProbeGetValue(sVar, sVal, sError) End Sub
Code:int SimIFaceNET::ProbeGetValue(String^ sVar, String^ sVal, String^ sError) { sVal = "3.444"; sError = sError->Empty; return -1; }




Reply With Quote