A
active
Private Structure TNavRec
<VBFixedString(100),System.Runtime.InteropServices.MarshalAs(System.Runtime.
InteropServices.UnmanagedType.ByValTStr,SizeConst:=100)> Public strItemName
As String
<VBFixedString(4),System.Runtime.InteropServices.MarshalAs(System.Runtime.In
teropServices.UnmanagedType.ByValTStr,SizeConst:=4)> Public strItemID As
String
<VBFixedString(2),System.Runtime.InteropServices.MarshalAs(System.Runtime.In
teropServices.UnmanagedType.ByValTStr,SizeConst:=2)> Public EndOfLine As
String
End Structure
--snip--
Dim ludtNavRec As TNavRec
'accept more than a record will hold
cboName.Text = VB.Left(Value, Len(ludtNavRec.strItemName))
------
In my program
Len(ludtNavRec.strItemName)
returns 0 (probably because I haven't stored anything into it yet).
Probably returning the length of the variable string not the capacity.
I could, of course, store the max length (100) in a const and use that but
I wonder if there is a better way?
Thanks
<VBFixedString(100),System.Runtime.InteropServices.MarshalAs(System.Runtime.
InteropServices.UnmanagedType.ByValTStr,SizeConst:=100)> Public strItemName
As String
<VBFixedString(4),System.Runtime.InteropServices.MarshalAs(System.Runtime.In
teropServices.UnmanagedType.ByValTStr,SizeConst:=4)> Public strItemID As
String
<VBFixedString(2),System.Runtime.InteropServices.MarshalAs(System.Runtime.In
teropServices.UnmanagedType.ByValTStr,SizeConst:=2)> Public EndOfLine As
String
End Structure
--snip--
Dim ludtNavRec As TNavRec
'accept more than a record will hold
cboName.Text = VB.Left(Value, Len(ludtNavRec.strItemName))
------
In my program
Len(ludtNavRec.strItemName)
returns 0 (probably because I haven't stored anything into it yet).
Probably returning the length of the variable string not the capacity.
I could, of course, store the max length (100) in a const and use that but
I wonder if there is a better way?
Thanks