R
Rick Knospler
I am trying to convert a vb6 project to vb.net. The conversion worked for
the most part except for the fixed length strings and fixed length string
arrays. Bascially the vb6 programmer stored all form data in a fixed length
structure that is written direct to disk.
I need to load the existing files, into a fixed length structure to
initialize the form data within the project.
I am running into problems with statements like the following..
Original vb6 code looked something like:
Type formcfg
'General
CustId As String * 40
CellIdParam(0 To 7) As String * 8
end type
Public c As formcfg
The c structure is loaded with a routine like:
Open File$ For Random As #1 Len = Len(c)
Get #1, 1, c
Close #1
After converting to vb.net I see this code:
'UPGRADE_WARNING: Fixed-length string size must fit in the buffer. Click for
more:
'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
<VBFixedString(40),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,
SizeConst:=41)> Public CustId() As Char
and
'UPGRADE_ISSUE: Declaration type not supported: Array of fixed-length
strings. Click for more:
'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="934BD4FF-1FF9-47BD-888F-D411E47E78FA"'
Dim TestParam(7) As String * 8
How do I recreate the functionallity that I need to work with these saved
structure files that are fixed length..? The fixed length strings have -1
appeneded to the end and therefore increase the size by 1. Is there a way
to handle this type of problem?
Thanks..
-Rick
the most part except for the fixed length strings and fixed length string
arrays. Bascially the vb6 programmer stored all form data in a fixed length
structure that is written direct to disk.
I need to load the existing files, into a fixed length structure to
initialize the form data within the project.
I am running into problems with statements like the following..
Original vb6 code looked something like:
Type formcfg
'General
CustId As String * 40
CellIdParam(0 To 7) As String * 8
end type
Public c As formcfg
The c structure is loaded with a routine like:
Open File$ For Random As #1 Len = Len(c)
Get #1, 1, c
Close #1
After converting to vb.net I see this code:
'UPGRADE_WARNING: Fixed-length string size must fit in the buffer. Click for
more:
'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="3C1E4426-0B80-443E-B943-0627CD55D48B"'
<VBFixedString(40),
System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,
SizeConst:=41)> Public CustId() As Char
and
'UPGRADE_ISSUE: Declaration type not supported: Array of fixed-length
strings. Click for more:
'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="934BD4FF-1FF9-47BD-888F-D411E47E78FA"'
Dim TestParam(7) As String * 8
How do I recreate the functionallity that I need to work with these saved
structure files that are fixed length..? The fixed length strings have -1
appeneded to the end and therefore increase the size by 1. Is there a way
to handle this type of problem?
Thanks..
-Rick