Error Running Converted C-Sharp Code

Posts 1–6 of 6 · Page 1 of 1
Error Running Converted C-Sharp Code
this is WORKING CS code :

Code:
    MethodInfo mi = methods[lbAvailableMethodsList.SelectedIndex];
               ilread.MethodBodyReader mr = new MethodBodyReader(mi);
                listBox1.Items.Clear();
                listBox1.Items.Add(mr.GetBodyCode());

and this is converted but not working vb code :

Code:
    Dim mi As MethodInfo = methods(ListBox1.SelectedItem.ToString)
            Dim mr As ilread.MethodBodyReader  = New MethodBodyReader(mi)

           ListBox2.Items.Clear()
        ListBox2.Items.Add(mr.GetBodyCode)
gives error in this line : Dim mi As MethodInfo = methods(ListBox1.SelectedIndex)


error is something like that
mm its turkish tried to translate with google , error is something like that : "Button1_Click" string 'Integer' to the type of conversion is not valid.
.SelectedIndex is the index value of the selected item in the list... You can't use the .SelectedItem field to do that...
code = Globals.singleByteOpCodes[(int)value];

now i need a problem with this error
Simple casting. C# uses the C-style cast: (<typename>)value, VB uses the infinitely uglier "CType" keyword.

CType(value, <typename>)
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us