N
Nick Pateman
Hi there,
Previously in 1.1 .NET Framework if you were to access a control from
another thread you would not recieve an exception by default, instead it was
down to you and/or the control to prevent anything untoward happening.
Anyway, in 2.0 an exception is thrown the second you attempt to do this.
So I'm replacing large chunks of code to remove this problem. The only
thing is I would like to check that I am using the correct procedure.
I am calling the invoke method of the form that created the control.
The only problem here is that if the method requires parameters I need to
pass them in an array of objects...
Private sub changeControlsProperties(Byval iArgs() as Object)
Dim pStrString as String = CStr(iArgs(0))
Dim pIntInteger as Integer = CInt(IArgs(1))
... so on and so fourth and such like ...
End Sub
This doesn't seem like a very nice way to be calling a method so I'm
wondering if anyone knows of any other techniques for handling this "cross
threading" issue.
Nick.
Previously in 1.1 .NET Framework if you were to access a control from
another thread you would not recieve an exception by default, instead it was
down to you and/or the control to prevent anything untoward happening.
Anyway, in 2.0 an exception is thrown the second you attempt to do this.
So I'm replacing large chunks of code to remove this problem. The only
thing is I would like to check that I am using the correct procedure.
I am calling the invoke method of the form that created the control.
The only problem here is that if the method requires parameters I need to
pass them in an array of objects...
Private sub changeControlsProperties(Byval iArgs() as Object)
Dim pStrString as String = CStr(iArgs(0))
Dim pIntInteger as Integer = CInt(IArgs(1))
... so on and so fourth and such like ...
End Sub
This doesn't seem like a very nice way to be calling a method so I'm
wondering if anyone knows of any other techniques for handling this "cross
threading" issue.
Nick.