Click here to Skip to main content
15,900,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows service using Com dll Pin
Ankit Aneja11-Nov-05 0:37
Ankit Aneja11-Nov-05 0:37 
Question(Yet Another) Dockable Window/Form Question Pin
TheBlindWatchmaker10-Nov-05 21:15
TheBlindWatchmaker10-Nov-05 21:15 
AnswerRe: (Yet Another) Dockable Window/Form Question Pin
Robert Rohde11-Nov-05 7:00
Robert Rohde11-Nov-05 7:00 
QuestionArea Partition of irregualr polygon in C# Pin
satish090910-Nov-05 20:24
satish090910-Nov-05 20:24 
QuestionA True Global Class? Pin
redfish3410-Nov-05 20:24
redfish3410-Nov-05 20:24 
AnswerRe: A True Global Class? Pin
Craig G Fraser10-Nov-05 22:48
Craig G Fraser10-Nov-05 22:48 
GeneralRe: A True Global Class? Pin
redfish3415-Nov-05 19:24
redfish3415-Nov-05 19:24 
QuestionCreating forms on different threads Pin
kourvoisier10-Nov-05 19:57
kourvoisier10-Nov-05 19:57 
This is my situation.

I am creating an instant messenger

I have a main method which calls application.run(new form1())

This launches my main form.

I start another thread in my form1 constructor that sits in the background and soley listens for incoming connections

code:

public form1()
{
InitializeComponent()
Thread t = new Thread(new ThreadStart(ListenNewConnections));
t.Start();
}

When thread t finally gets a new connection that thread itself shoots off another thread "A"
to handle that particular connection thru out its life span. Once that connection is done so is the thread.

Now when thread "A" is handling a specific connection I want it to create a form - this is where the problem starts.

1st thing i did
newform.Show() - creates a blank form and when mouse over u get hour glass
I think the reason for this is because it is not starting on the main thread for message pumping.

Ok so second thing i do is use a delegate
this.BeginInvoke(new createFormdelegate(createForm)); //create form method simply initializes a new form and calls newform.Show().

but when i debug it stops at the this.BeginInvoke line an gives me this error
"Invoke or BeginInvoke cannot be called on a control until the window handle has been created."

I know i am doing something wrong. Maybe my c# logical thinking is off i dont know.

Please help

Thanks in advance

Kourvoisier
AnswerRe: Creating forms on different threads Pin
jonny511-Nov-05 0:23
jonny511-Nov-05 0:23 
GeneralRe: Creating forms on different threads Pin
kourvoisier11-Nov-05 3:45
kourvoisier11-Nov-05 3:45 
GeneralRe: Creating forms on different threads Pin
kourvoisier11-Nov-05 8:54
kourvoisier11-Nov-05 8:54 
GeneralRe: Creating forms on different threads Pin
Curtis Schlak.14-Nov-05 4:04
Curtis Schlak.14-Nov-05 4:04 
GeneralRe: Creating forms on different threads EVEN BETTER Pin
Curtis Schlak.14-Nov-05 4:42
Curtis Schlak.14-Nov-05 4:42 
GeneralRe: Creating forms on different threads EVEN BETTER Pin
kourvoisier14-Nov-05 5:16
kourvoisier14-Nov-05 5:16 
GeneralRe: Creating forms on different threads EVEN BETTER Pin
Curtis Schlak.14-Nov-05 5:51
Curtis Schlak.14-Nov-05 5:51 
GeneralRe: Creating forms on different threads EVEN BETTER Pin
kourvoisier14-Nov-05 12:18
kourvoisier14-Nov-05 12:18 
QuestionSet form's owner to a window outside the application? Pin
MogobuTheFool10-Nov-05 19:45
MogobuTheFool10-Nov-05 19:45 
AnswerRe: Set form's owner to a window outside the application? Pin
Dave Kreskowiak11-Nov-05 3:57
mveDave Kreskowiak11-Nov-05 3:57 
GeneralRe: Set form's owner to a window outside the application? Pin
MogobuTheFool7-Jul-06 8:32
MogobuTheFool7-Jul-06 8:32 
GeneralRe: Set form's owner to a window outside the application? Pin
Dave Kreskowiak7-Jul-06 10:16
mveDave Kreskowiak7-Jul-06 10:16 
GeneralRe: Set form's owner to a window outside the application? Pin
MogobuTheFool8-Jul-06 4:18
MogobuTheFool8-Jul-06 4:18 
Questionsetting the date format of the calendar in a datetimepicker Pin
microsoc10-Nov-05 19:28
microsoc10-Nov-05 19:28 
AnswerRe: setting the date format of the calendar in a datetimepicker Pin
krario10-Nov-05 20:07
krario10-Nov-05 20:07 
GeneralRe: setting the date format of the calendar in a datetimepicker Pin
microsoc10-Nov-05 20:20
microsoc10-Nov-05 20:20 
QuestionStatic and Dynaminc Assemblies ? Pin
webC#10-Nov-05 19:08
webC#10-Nov-05 19:08 

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.