Sign in
Write Ahead Blog
rushi desai | developer | zune service
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Email Blog Author
Share this
RSS for posts
Atom
RSS for comments
Search
Tags
No tags have been created or used yet.
Archive
Archives
November 2007
(1)
September 2006
(2)
April 2006
(1)
December 2005
(3)
November 2005
(1)
September 2005
(3)
June 2005
(4)
May 2005
(4)
April 2005
(2)
March 2005
(9)
February 2005
(11)
Stumbling into cross-threading issues with winforms
MSDN Blogs
>
Write Ahead Blog
>
Stumbling into cross-threading issues with winforms
Stumbling into cross-threading issues with winforms
Rushi Desai
25 Feb 2005 10:01 AM
Comments
0
Having very little prior UI programming experience, I ventured into writing an instant messenger application (using SQL Service Broker of course). After doodling around with VC# and generously
lock
ing shared data structures, I thought I had got it right. But when I started the application and attempted to send a message the receiving client threw an
Illegal cross-threading exception
. My reaction was "huh?" The textbox I was trying to update was under a lock. And I was certain this worked with .NET 1.1 (and Java Swing). But soon I searched on the web and realized this wasn't possible with .NET 2.0. I'm sure they had reasons to prevent it and there are workarounds involving delegates and events. But by then I had lost interest in my chat program. Maybe I need to find out more about how Windows processes events using the message pump. The answer may be hidden deep there.
0 Comments
Blog - Comment List MSDN TechNet
Comments
Loading...