|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Parameter count mismatch??? passing an array to Invokeworkaround? 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 > Dim someParms(2) As Object Should be someParms(1) if you only have two parameters.> Invoke(myDel, someParms) ' doesn't work :( TryInvoke(myDel, New Object() {someParms}) Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. Yes, thank you!
Mattias Sjögren wrote: Show quoteHide quote > > Dim someParms(2) As Object > > Should be someParms(1) if you only have two parameters. > > > > Invoke(myDel, someParms) ' doesn't work :( > > Try > > Invoke(myDel, New Object() {someParms}) > > > Mattias > > -- > Mattias Sjögren [C# MVP] mattias @ mvps.org > http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com > Please reply only to the newsgroup.
Changing datagridview cell borders at runtime
best way for Replace insensitive in strings Newbie question on comboboxes DataBase Programming How do you see if a table already exists in a database? VB6 to VB2005 question about Frame control How do I load HTML into an instance of SHDocVw.InternetExplorer Executing a SQL2005 Stored Procedure vb.net code for advanced data structures Help! Monitoring Process with Different Threads Error |
|||||||||||||||||||||||