M
Mike
Hi, we have many 3rd party developers using our VB server interface
API with structures with fields that are based 1 array bounds, i.e.,
Type Tuser
...
Security(1 to NUM_USER_SECURITY) as String*SIZE_SECURITY_NAME
End type
type TFullFileRecord
..
LongDescription(1 to MAX_LONGDESC_LINES) as String*SIZE_LONGDESC
end type
etc.
For our VB.NET port, and for the sake of some level of USAGE
compatibility, I want (desire) to maintain the long traditional idea
for BASIC programmers that these fields are based one. We also have an
server-side embedded BASIC language that are based 1 as well. So it
would help to maintain this concept.
Currently, I am using a VB.NET structure like so for TUser
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>
Public Structure TSecurityName
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=SIZE_SECURITY_NAME)>
Public Name As String
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>
Public Structure TUser
...
<MarshalAs(UnmanagedType.ByValArray,sizeconst:=NUM_USER_SECURITY)>
Public Security() As TSecurityName
sub init()
redim Security(NUM_USER_SECURITY-1)
end sub
End Structure
and as we know the lower and upper bound here is 0 to NUM_USER_SECURITY-1.
Short of using a class wrapper, maybe a Get/Set Property, is there a
way or method to declare, maybe at the compiler level what the lower
bound would be?
I am trying to maintain with the <structurelayout> for marshalling
purposes, and avoid writing our own fixed structure/class marshalling
handler. But then again, it seems .NET is so rich with implementation
interfaces, it might be feasible to explore some replacement interface.
what say you?
Thanks in advance
--
API with structures with fields that are based 1 array bounds, i.e.,
Type Tuser
...
Security(1 to NUM_USER_SECURITY) as String*SIZE_SECURITY_NAME
End type
type TFullFileRecord
..
LongDescription(1 to MAX_LONGDESC_LINES) as String*SIZE_LONGDESC
end type
etc.
For our VB.NET port, and for the sake of some level of USAGE
compatibility, I want (desire) to maintain the long traditional idea
for BASIC programmers that these fields are based one. We also have an
server-side embedded BASIC language that are based 1 as well. So it
would help to maintain this concept.
Currently, I am using a VB.NET structure like so for TUser
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>
Public Structure TSecurityName
<MarshalAs(UnmanagedType.ByValTStr, sizeconst:=SIZE_SECURITY_NAME)>
Public Name As String
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Ansi)>
Public Structure TUser
...
<MarshalAs(UnmanagedType.ByValArray,sizeconst:=NUM_USER_SECURITY)>
Public Security() As TSecurityName
sub init()
redim Security(NUM_USER_SECURITY-1)
end sub
End Structure
and as we know the lower and upper bound here is 0 to NUM_USER_SECURITY-1.
Short of using a class wrapper, maybe a Get/Set Property, is there a
way or method to declare, maybe at the compiler level what the lower
bound would be?
I am trying to maintain with the <structurelayout> for marshalling
purposes, and avoid writing our own fixed structure/class marshalling
handler. But then again, it seems .NET is so rich with implementation
interfaces, it might be feasible to explore some replacement interface.
what say you?
Thanks in advance
--