Recommendations

     

     

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

     

     

    For exaple 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;

    }

    Updated for VBUC v3.0

    Last generated on 6/19/2009 10:03:17 AM


    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