473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Using Threading

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
1 861
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Egor Bolonev | last post by:
hi all my program terminates with error i dont know why it tells 'TypeError: run() takes exactly 1 argument (10 given)' =program==================== import os, os.path, threading, sys def...
0
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with...
11
by: Doug Thews | last post by:
I've been working on some samples that use BeginInvoke/EndInvoke. In one example, I call BeginInvoke and pass it an AsyncCallback function pointer. I was messing around with ReaderWriterLocks and...
2
by: AtherMurtuzapurwala | last post by:
Hi All, Client/Server Program using Sockets... Server sends request in form of CSV format in NetworkStream... So I want to read this using threading because it is in very large volume so...
6
by: Simon Verona | last post by:
I would normally use code such as : Dim Customer as new Customer Dim t as new threading.thread(AddressOf Customer.DisplayCustomer) Customer.CustomerId=MyCustomerId t.start Which would create...
5
by: notregister | last post by:
Hi, i am trying to print the same document to at 3 printers at the same time, i tried using printdocument in looping fashion but they would wait for one printer to print finish before going to the...
17
by: OlafMeding | last post by:
Below are 2 files that isolate the problem. Note, both programs hang (stop responding) with hyper-threading turned on (a BIOS setting), but work as expected with hyper-threading turned off. ...
4
by: Bharathi | last post by:
Hi, Iam working in windows appln using .NET framework 2.0. My application is having several threads running. All threads can call a common method.
6
by: Gina_Marano | last post by:
Hey All, I am using multiple child threads per main thread to download files. It sometimes appears as if the same file is being downloaded twice. I am using "lock". Am I using it correctly? Any...
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.