A
andrewbb
This is fairly simple code, what am I missing or is there a potential
workaround?
It fails when passing someParms to Invoke with "Parameter count
mismatch". I created a test with an empty form and a single button.
Thanks in advance.
By the way, in case you're wondering why... I want to call into the
form from a different thread to update controls.
Private Delegate Sub MyDelegate(ByVal parm() As Object)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim myDel As MyDelegate
myDel = New MyDelegate(AddressOf AProcedure)
Dim someParms(2) As Object
someParms(0) = "abc"
someParms(1) = "def"
myDel.Invoke(someParms) 'WORKS!
Invoke(myDel, someParms) ' doesn't work
End Sub
Private Sub AProcedure(ByVal parm() As Object)
MessageBox.Show(parm.Length)
End Sub
workaround?
It fails when passing someParms to Invoke with "Parameter count
mismatch". I created a test with an empty form and a single button.
Thanks in advance.
By the way, in case you're wondering why... I want to call into the
form from a different thread to update controls.
Private Delegate Sub MyDelegate(ByVal parm() As Object)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim myDel As MyDelegate
myDel = New MyDelegate(AddressOf AProcedure)
Dim someParms(2) As Object
someParms(0) = "abc"
someParms(1) = "def"
myDel.Invoke(someParms) 'WORKS!
Invoke(myDel, someParms) ' doesn't work
End Sub
Private Sub AProcedure(ByVal parm() As Object)
MessageBox.Show(parm.Length)
End Sub