all groups > c# > april 2005 >
You're in the

c#

group:

Can't suspend a thread


Can't suspend a thread emr
4/2/2005 7:55:25 PM
c#:
Hi there, here is the situation:

private void btnStart_Click(object sender, System.EventArgs e)

{

if(btnStart.Text=="START")

{

Thread connect=new Thread(new ThreadStart(Connect2Server));

connect.Start();

}

if(btnStart.Text=="STOP")

{

connect.Suspend(); // An unhandled exception of type
'System.NullReferenceException' occurred in .exe Additional information:
Object reference not set to an instance of an object.

btnStart.Text="RESUME";

.....

thank you

Re: Can't suspend a thread emr
4/2/2005 8:16:59 PM
solved the problem but a new one :(

connect.Start(); //everything ok it does whatever i want//
lstResult.Items.Add(connect.ThreadState);

it prints unstarted ??

AddThis Social Bookmark Button