Click here to Skip to main content
15,915,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:45
JoeRip4-Jan-07 20:45 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:05
Phillip M. Hoff4-Jan-07 21:05 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:12
JoeRip4-Jan-07 21:12 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:25
Phillip M. Hoff4-Jan-07 21:25 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:34
JoeRip4-Jan-07 21:34 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:45
Phillip M. Hoff4-Jan-07 21:45 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:47
JoeRip4-Jan-07 21:47 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Luc Pattyn5-Jan-07 4:22
sitebuilderLuc Pattyn5-Jan-07 4:22 
Hi,

you discovered Controls are not thread-safe, and can be only handled coreectly by the
UI thread. Using InvokeRequired and Invoke supports this, but needs the programmer's action.

Having it done automatically could result in terrible performance:
the method you Invoke ends up in a queue, waiting for the UI thread to
become ready to handle it.

So it is the designer/programmer's responsibility to decide which piece of code should
execute on which thread. Imagine a method with a for-loop that updates some Control
(say all items in a ListBox). Rather than having the control do its own Invoke,
a proper design would have the etnire method run on the UI thread, involving only
one Invoke.

This is a design issue. Something similar is true about locking in a multi-threaded
environment (independent of COntrols); locks must be there by design, and
not be inserted automatically.

Smile | :)

Luc Pattyn

GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:15
JoeRip4-Jan-07 20:15 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:20
JoeRip4-Jan-07 20:20 
QuestionVirus Pin
Tyler454-Jan-07 15:45
Tyler454-Jan-07 15:45 
AnswerRe: Virus [modified] Pin
Vega024-Jan-07 16:06
Vega024-Jan-07 16:06 
AnswerRe: Virus Pin
leppie4-Jan-07 16:54
leppie4-Jan-07 16:54 
AnswerRe: Virus Pin
Christian Graus4-Jan-07 18:03
protectorChristian Graus4-Jan-07 18:03 
QuestionRe: Virus Pin
Tyler454-Jan-07 18:58
Tyler454-Jan-07 18:58 
AnswerRe: Virus Pin
Chris Buckett4-Jan-07 21:13
Chris Buckett4-Jan-07 21:13 
AnswerRe: Virus Pin
Hamid_RT4-Jan-07 18:44
Hamid_RT4-Jan-07 18:44 
AnswerRe: Virus Pin
Tyler454-Jan-07 20:34
Tyler454-Jan-07 20:34 
GeneralRe: Virus Pin
Pete O'Hanlon4-Jan-07 22:26
mvePete O'Hanlon4-Jan-07 22:26 
AnswerRe: Virus Pin
Mircea Puiu4-Jan-07 20:49
Mircea Puiu4-Jan-07 20:49 
AnswerRe: Virus Pin
lost in transition 5-Jan-07 4:06
lost in transition 5-Jan-07 4:06 
Questionend of line character Y position Pin
netJP12L4-Jan-07 11:15
netJP12L4-Jan-07 11:15 
AnswerRe: end of line character Y position Pin
Christian Graus4-Jan-07 11:30
protectorChristian Graus4-Jan-07 11:30 
QuestionEmbedded Progressbar Problem Pin
slugonamission4-Jan-07 10:28
slugonamission4-Jan-07 10:28 
AnswerRe: Embedded Progressbar Problem Pin
Judah Gabriel Himango4-Jan-07 11:32
sponsorJudah Gabriel Himango4-Jan-07 11:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.