T
Thai Mai Shu
What is wrong with my call below. If I change the
delegate and the CallBackComplete function to not take in
parameters then the .Invoke call works fine. As soon as I
put the parameters back I get "Parameter count mismatch."
error. Am I supposed to implement ISynchronizeInvoke in
order to call .Invoke? If so, why does it work when the
method i am trying to invoke has no parameters.
Private Delegate Sub CallbackCompleteDelegate(ByVal args()
As Object)
Private Sub SomeCallback(ByVal ACResult As IAsyncResult)
' calls .EndInvoke and does some async work
Dim Test As New CallbackCompleteDelegate(AddressOf
CallbackComplete)
Dim args(1) As Object
args(0) = "one"
args(1) = "two"
MainForm.Invoke(Test, args)
End Sub
Private Sub CallbackComplete(ByVal args() As Object)
' not even accessing the parameters
Debug.WriteLine("CallbackComplete - " &
AppDomain.GetCurrentThreadId)
End Sub
delegate and the CallBackComplete function to not take in
parameters then the .Invoke call works fine. As soon as I
put the parameters back I get "Parameter count mismatch."
error. Am I supposed to implement ISynchronizeInvoke in
order to call .Invoke? If so, why does it work when the
method i am trying to invoke has no parameters.
Private Delegate Sub CallbackCompleteDelegate(ByVal args()
As Object)
Private Sub SomeCallback(ByVal ACResult As IAsyncResult)
' calls .EndInvoke and does some async work
Dim Test As New CallbackCompleteDelegate(AddressOf
CallbackComplete)
Dim args(1) As Object
args(0) = "one"
args(1) = "two"
MainForm.Invoke(Test, args)
End Sub
Private Sub CallbackComplete(ByVal args() As Object)
' not even accessing the parameters
Debug.WriteLine("CallbackComplete - " &
AppDomain.GetCurrentThreadId)
End Sub