J
John
I am trying to call a third party company's dll that I have no control
over. They tell me it was written in C. The declaration in VB6 is as
follows:
Private Declare Sub csub Lib "rlpolk.dll" (ByVal T_VININ As String, _
ByVal T_VINOUT As String, ByVal i_bypass As
Integer)
The T_VININ string is 25 characters and the T_VINOUT string is 108. I
have tried to convert the declaration to VB.NET with little success:
Class Polk
<DllImport("c:\rlpolk.dll", EntryPoint:="microvin", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function csub(ByVal T_VININ As String, _
ByVal T_VINOUT As String, ByVal i_byPass As Integer)
End Function
End Class
The call to the routine is:
Polk.csub(T_VININ, T_VINOUT, 98)
When I do this, I get the message that PInvoke cannot return a
Variant.
If I change it to a Sub, the call to the routine returns nothing.
T_VININ is the variable sent to the routine and T_VINOUT should be the
return string. (T_VININ is a VIN number and T_VINOUT is a 108
character explosion of the vin.)
I have tried many combinations including trying to Marshal the
strings, but all have failed. Please help. Thank you.
John Germani
over. They tell me it was written in C. The declaration in VB6 is as
follows:
Private Declare Sub csub Lib "rlpolk.dll" (ByVal T_VININ As String, _
ByVal T_VINOUT As String, ByVal i_bypass As
Integer)
The T_VININ string is 25 characters and the T_VINOUT string is 108. I
have tried to convert the declaration to VB.NET with little success:
Class Polk
<DllImport("c:\rlpolk.dll", EntryPoint:="microvin", _
SetLastError:=True, CharSet:=CharSet.Unicode, _
ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function csub(ByVal T_VININ As String, _
ByVal T_VINOUT As String, ByVal i_byPass As Integer)
End Function
End Class
The call to the routine is:
Polk.csub(T_VININ, T_VINOUT, 98)
When I do this, I get the message that PInvoke cannot return a
Variant.
If I change it to a Sub, the call to the routine returns nothing.
T_VININ is the variable sent to the routine and T_VINOUT should be the
return string. (T_VININ is a VIN number and T_VINOUT is a 108
character explosion of the vin.)
I have tried many combinations including trying to Marshal the
strings, but all have failed. Please help. Thank you.
John Germani