Link to home
Create AccountLog in
Avatar of shprakash
shprakash

asked on

vb6 to vb.net converstion

vb6 code is this..
 Private Type Record
        rsRecID As String * 2
        rsDate As String * 8
        rsTime As String * 4
        rsFiller1 As String * 42
        rsTotal As String * 14
        rsFiller2 As String * 4
       End Type
 when i use upgrade wizard it says
<VBFixedString(2),System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray,SizeConst:=2)> Public rsRecID() As Char
 I tried with your solution by importing the namespace in VB.Net 2.0 but it is not working...
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Use a Structure instead....
    Private Structure Record
        <VBFixedString(2)> Public rsRecID As String
        <VBFixedString(8)> Public rsDate As String
        <VBFixedString(4)> Public rsTime As String
        <VBFixedString(42)> Public rsFiller1 As String
        <VBFixedString(14)> Public rsTotal As String
        <VBFixedString(4)> Public rsFiller2 As String
    End Structure

Open in new window

Right...see:
http://msdn2.microsoft.com/en-us/library/aa903289(VS.71).aspx

Also, follow the links at the bottom of that page for more examples.
ASKER CERTIFIED SOLUTION
Avatar of Shanmuga Sundaram D
Shanmuga Sundaram D
Flag of India image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
>>The code which you were searching for should be here.

It's also here -> http:#a21054673