WARNING #1063

    Arrays in structure %1 may need to be initialized before they can be used.

    Description

    In Visual Basic .NET, fixed-size arrays in structures are not supported. Fixed-size arrays that are members of structures defined in COM interfaces will need to be initialized before they can be used.

    Recommendations

    Call function Initialize of the structure, just after the variable declaration.

    For example Structure2 will be defined as:

    privatestruct Structure2
    {
    publicint Size;
    publicint[] Numbers;
    publicvoid Initialize()
    {
    Numbers = newint[]{};
    }
    }

    Sample VB6

    Private Type Structure2
        Size AsInteger
        Numbers() AsString
    End Type
    Private Type Structure1
       name AsString
       str2 As Structure2
    End Type

    Target VB.NET

    PrivateStructure Structure2
       Dim Size AsInteger
       Dim Numbers() AsString
    EndStructure
    PrivateStructure Structure1
       Dim name AsString
       'UPGRADE_WARNING: (1063) Arrays in structure str2 may need to be initialized before they can be used.
       Dim str2 As Structure2
    EndStructure

    Target C#

    privatestructStructure2
    {
       publicint Size;
       publicint[] Numbers;
    }
    privatestructStructure1
    {
       publicstring name;
       //UPGRADE_WARNING: (1063) Arrays in structure str2 may need to be initialized before they can be used.
       publicStructure2 str2;
    }


    Download VBUC Free Trial
    Download VBUC Now

    It's time to eradicate VB6
    ROI of eradicating VB6

    8 Proven Tips for
    Planning a Successful Migration

    8 Tips for migration