Renaming References of Implementing Members

    This issue applies only for C# target language.

    The problem appears when an implementing member from a class is referenced in or out of the class. Remember, the implementing member in Visual Basic 6 is formed <Interface>_<Member>, and the target upgrade must remove the <Interface> prefix in order to get a correct syntax. It causes references to these members to be renamed to this new name to get the same functionality.

    Original VB6 code

    AClass.cls
    Implements AnInterface
    Sub AnInterface_AMethod(ByVal anArg As String)
        ' Code
    End Sub
    Sub MyMethod()
        AnInterface_AMethod ""
    End Sub
    
    AModule.vb
    
    Private Sub Foo()
        Dim c As New AClass
        c.AnInterface_AMethod ""
    End Sub
    

    VBUC resulting C#.NET code

    AClass.cls
    
        internal class Class1
        : AnInterface
        {
            public void  AMethod(string anArg)
            {
                // Code
            }
            public void  MyMethod()
            {
                AMethod("");
            }
        }
    
    AModule.vb
    
        private void  Foo()
        {
            Class1 c = new Class1();
            c.AMethod("");
        }

    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