.... my eternal gratitude!!! :p
Here is the problem. A sample of my original VB6 code :
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
Public Type INFO
name(1 To 3) As String * 41
address As String * 41
End Typ
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
I used to be able to get the length of any element in my type with the
following code:
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
dim INFO as INFO
dim temp as string = Len(INFO.address)
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
The value of temp would then be 41
With my new VB.NET code, I try to use the following code, but whatever I
try, the value of temp is always 0
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
Public Structure INFO
<VBFixedString(41)> public name(1 To 28) As String
<VBFixedString(41)> public address As String
End Structure
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
dim INFO as INFO
dim temp as integer = Microsoft.VisualBasic.Len(INFO.address)
or
dim temp as integer =
System.Runtime.InteropServices.Marshal.SizeOf(INFO .address)
'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''
In the latter case, the return value is a null and my application crashes.
Any input on this would be extremely appreciated.
Thank you.