By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,702 Members | 1,771 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,702 IT Pros & Developers. It's quick & easy.

Using Threading

P: n/a
Hello,

Can you help me with this problem?
I've developed a Class (class A) that receives socket events, itis handled in a Thread that raise events to other class (ClassB) that has instanced this class. The class Class B cannot showa form in the event because the form locked. Why it occours? I'mshowing not modal form, it's look like I'm blocking the threadthat raise events..

--------------------------------
From: Daniel Romaniuk

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>YSKZoFnjM0iYiFhQgylaxw==</Id>
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi, Daniel

You might need to check on which threads your events are executed. Easiest
way is to use Debug.Print or Console.WriteLine in event handlers, which
print thread id or names (if have them unique for every thread running). It
might happen you try to show form on non-UI thread. That's one thing.
Another is - how you show form, Form.Show or Form.ShowDialog?
ShowDialog might work Ok, Show will require message pump, which exists only
on UI thread.

HTH
Alex

"Daniel Romaniuk via .NET 247" <an*******@dotnet247.com> wrote in message
news:Oy**************@TK2MSFTNGP10.phx.gbl...
Hello,

Can you help me with this problem?
I've developed a Class (class A) that receives socket events, it is handled
in a Thread that raise events to other class (Class B) that has instanced
this class. The class Class B cannot show a form in the event because the
form locked. Why it occours? I'm showing not modal form, it's look like I'm
blocking the thread that raise events..

--------------------------------
From: Daniel Romaniuk

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>YSKZoFnjM0iYiFhQgylaxw==</Id>
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.