manjunath cv

Hi i am implementing a thread to seperate UI and background process but when i am compiling/debugging i used to get cross thread invalid error... but i could not able to eliminate it..........  in one of the forum i got know enabling the property
"Control.CheckForIllegalCrossThreadCalls = false;" will make the error go away... i used it and my program is working great.....

but i am fearing whether there is any issues or problem which occur by using this property....

please can any of u guys who knows about it can share any ideas of using this property i am using this property only in the Main form....

Thanks,


Re: Windows Forms General Control.CheckForIllegalCrossThreadCalls=false any problem using it????????

TilakGopi

Hi,

Sorry for answering inappropriately to ur question. I don't know about the property, u r asking about.

But for such cross thread calls,it's much better use delegates, i feel.

Thanx,

Ch.T.Gopi Kumar.






Re: Windows Forms General Control.CheckForIllegalCrossThreadCalls=false any problem using it????????

Mattias Sjogren

Resolving errors is usually better than ignoring them, if that's waht you're asking.




Re: Windows Forms General Control.CheckForIllegalCrossThreadCalls=false any problem using it????????

Friendly Dog

Control is not thread-safe. The result of cross-thread access to Control is "undefined" - there's no guarantee what will happen, you may get different results for no appearant reason. For many cases (at least for me so far) you won't notice much of the problem but when it breaks, there's no way to fix it because that's expected "undefined" behavior.






Re: Windows Forms General Control.CheckForIllegalCrossThreadCalls=false any problem using it????????

Matthew Watson

You should fix the problem.

To fix it, you must read up on the following:

Control.InvokeRequired
Control.BeginInvoke or Control.Invoke

See this Microsoft example for more details.