[Mono-bugs] [Bug 354226] New: late binding on structures doesn't work

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jan 16 12:20:52 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=354226


           Summary: late binding on structures doesn't work
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: ASSIGNED
          Severity: Normal
          Priority: P5 - None
         Component: VB Runtime
        AssignedTo: rkvinge at novell.com
        ReportedBy: rkvinge at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Imports System.Windows.Forms

Public Class Form1
        Inherits Form

        public shared sub Main 
                dim f as new Form1
                f.Show
        end sub

    Private collection As New Collection
    Friend Structure thing
        Dim num As Int32     'Room ID number
        Dim Name As String  'The name of the room - E.G. "L9" Is one of my
computing classrooms
    End Structure


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        Dim thing As thing

        thing.num = 1
        thing.Name = "one"

        collection.Add(thing)


        thing.num = 2
        thing.Name = "two"

        collection.Add(thing)


        thing.num = 1
        thing.Name = "three"

        collection.Add(thing)


        Dim index As Integer = 2
        Dim num As Integer = 1
        MsgBox("starting test")
        If collection(index).num = num Then 'if id passed equals id in database
            MsgBox("tada")
        Else
            MsgBox("Not tada")
        End If
    End Sub
End Class





rolf at linux:~/test> mono vb.exe

Unhandled Exception: System.MissingMemberException: Cannot find the requested
class member.
  at Microsoft.VisualBasic.CompilerServices.LateBinder.BindToMethod
(BindingFlags bindingAttr, System.Reflection.MethodBase[] match,
System.Object[]& args, System.Reflection.ParameterModifier[] modifiers,
System.Globalization.CultureInfo culture, System.String[] names, System.Object&
state) [0x00000]
  at System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr,
System.Reflection.Binder binder, System.Object target, System.Object[] args,
System.Reflection.ParameterModifier[] modifiers,
System.Globalization.CultureInfo culture, System.String[] namedParameters)
[0x00000]
  at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet (System.Object
o, System.Type objType, System.String name, System.Object[] args,
System.String[] paramnames, System.Boolean[] CopyBack) [0x00000]
  at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet
(System.Object Instance, System.Type Type, System.String MemberName,
System.Object[] Arguments, System.String[] ArgumentNames, System.Type[]
TypeArguments, System.Boolean[] CopyBack) [0x00000]
  at Form1.Form1_Load (System.Object sender, System.EventArgs e) [0x00000]
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000]
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000]
  at System.Windows.Forms.Form.OnCreateControl () [0x00000]
  at System.Windows.Forms.Control.CreateControl () [0x00000]
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&
m) [0x00000]
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x00000]
  at System.Windows.Forms.ScrollableControl.WndProc
(System.Windows.Forms.Message& m) [0x00000]
  at System.Windows.Forms.ContainerControl.WndProc
(System.Windows.Forms.Message& m) [0x00000]
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message& m)
[0x00000]
  at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.Forms.Message& m) [0x00000]
  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Forms.Message& m) [0x00000]
  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wParam, IntPtr lParam) [0x00000]
  at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message,
IntPtr wParam, IntPtr lParam) [0x00000]
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd hwnd,
WindowType windows) [0x00000]
  at System.Windows.Forms.XplatUIX11.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00000]
  at System.Windows.Forms.XplatUI.CreateWindow
(System.Windows.Forms.CreateParams cp) [0x00000]
  at System.Windows.Forms.NativeWindow.CreateHandle
(System.Windows.Forms.CreateParams create_params) [0x00000]
  at System.Windows.Forms.Control.CreateHandle () [0x00000]
  at System.Windows.Forms.Form.CreateHandle () [0x00000]
  at System.Windows.Forms.Control.CreateControl () [0x00000]
  at System.Windows.Forms.Control.SetVisibleCore (Boolean value) [0x00000]
  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000]
  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000]
  at System.Windows.Forms.Control.Show () [0x00000]
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:Show ()
  at Form1.Main () [0x00000]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list