473,320 Members | 1,951 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,320 software developers and data experts.

C#-Form: Difficulties with threading and new forms

Hi, I'm trying to write an IRC client (yeah, another one), and I've written a component that creates a thread that polls a socket for new information, parses new lines, and calls associated events (for example, an OnJoin delegate is called when a room is joined).

My problem is, I want a new form to be created when a room is joined, but every method I've tried for doing so creates either a modal form (not the desired type), or a form that freezes after it opens. So I guess my question is, what's the best way to open a responsive form from another thread? Is it possible? Is there a better approach? Any input would be appreciated.

I have tried researching other C# IRC components/clients, but they all work as I have described above. Most clients seem to have been written before updating the GUI from a separate thread became "illegal," and so no Invoke/BeginInvoke commands are illegal.

Thanks in advance for any help.
Jun 1 '08 #1
2 1036
kenobewan
4,871 Expert 4TB
Here is an article that may help you:
ASP.NET 2.0 Provider Model: Introduction to the Provider Model
Jun 2 '08 #2
Plater
7,872 Expert 4TB
Well there is something about GUI components on other threads that never seem to work so well. I think its because the windows messages never get to it.

If you want to trigger a new form to open, I think getting the GUI thread to do it would be best. Whatever form is open is probably already in the GUI thread, so have IT'S thread open the new form, possible use the InvokeRequired proeprty to make sure it happens on the gui thread
Jun 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Mahesh Devjibhai Dhola [MVP] | last post by:
We are building Chat like application using Forms and as a result our programming is becoming complicated to display messages received on different threads in the chat window (due to STA...
3
by: brett | last post by:
Using DOM in IE, how can I loop through FORMs and access FORM elements in a specific form? For example, www.hotmail.com has about 13 forms. I believe the one displayed is dependent on the URL. If...
13
by: RCS | last post by:
I have a UI that needs a couple of threads to do some significant processing on a couple of different forms - and while it's at it, update the UI (set textboxes, fill in listviews). I created a...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
7
by: Terry Olsen | last post by:
I run this code: Private Sub p_recv(ByVal sender As Object, ByVal e As SerialReceivedEventArgs) Handles p.ReceivedEvent txtRecv.Text += p.ReadExisting End Sub I get this error: ...
4
by: Bob | last post by:
- For cleanup, is it sufficient to set a Thread to Nothing after it's done? - It is OK to pass objects out of the thread? (dumb question maybe but I want to be sure) - What's the best way to...
0
by: Colmeister | last post by:
I recently read Jason Clark's excellent article on Unhandled Exceptions (http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx) and have attempted to incorporate the features he talks...
7
by: Mike P | last post by:
I am trying to write my first program using threading..basically I am moving messages from an Outlook inbox and want to show the user where the process is up to without having to wait until it has...
0
by: aparsons | last post by:
I have an MDI application in which I want the user to drag the child forms to put them in order. I will have to write some mouse handling code for that I know. However when you click on the child...
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, i have a main thread an another worker thread. The main Thread creates another thread and waits for the threads signal to continue the main thread. Everything works inside a ModalDialog and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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...
1
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...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.