Click here to Skip to main content
15,917,321 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can any solve this????? Pin
Ista8-Aug-03 6:10
Ista8-Aug-03 6:10 
AnswerRe: Can any solve this????? Pin
Ista9-Aug-03 12:18
Ista9-Aug-03 12:18 
Generaldetecting current line in a RichTextBox Pin
.gonad8-Aug-03 3:11
.gonad8-Aug-03 3:11 
GeneralRe: detecting current line in a RichTextBox Pin
Ista8-Aug-03 19:13
Ista8-Aug-03 19:13 
GeneralRe: detecting current line in a RichTextBox Pin
.gonad9-Aug-03 2:06
.gonad9-Aug-03 2:06 
GeneralRe: detecting current line in a RichTextBox Pin
Ista9-Aug-03 5:06
Ista9-Aug-03 5:06 
GeneralWinForms Plot Pin
Ikke8-Aug-03 1:51
Ikke8-Aug-03 1:51 
GeneralRe: WinForms Plot Pin
Ista8-Aug-03 6:19
Ista8-Aug-03 6:19 
GeneralRe: WinForms Plot Pin
Ikke8-Aug-03 6:50
Ikke8-Aug-03 6:50 
GeneralRe: WinForms Plot Pin
Ista8-Aug-03 9:32
Ista8-Aug-03 9:32 
Generalversioning problem Pin
devvvy7-Aug-03 22:57
devvvy7-Aug-03 22:57 
GeneralThread doesn't start with VS .NET 2003 Pin
MeisterBiber7-Aug-03 21:52
MeisterBiber7-Aug-03 21:52 
GeneralRe: Thread doesn't start with VS .NET 2003 Pin
Rein Hillmann8-Aug-03 5:38
Rein Hillmann8-Aug-03 5:38 
GeneralMulti-Threaded Programming Pin
monrobot137-Aug-03 17:12
monrobot137-Aug-03 17:12 
GeneralRe: Multi-Threaded Programming Pin
J. Dunlap7-Aug-03 17:35
J. Dunlap7-Aug-03 17:35 
GeneralRe: Multi-Threaded Programming Pin
monrobot138-Aug-03 3:15
monrobot138-Aug-03 3:15 
Should variables I need to use in a thread be static? I ask because this is what I'm trying to do:
// In the button click event
Thread myThread = new Thread (new ThreadStart (ThreadFunc));

if (button1.Text == "Connect")
{
        // this is called
	myThread.Start ();
	button1.Text = "Disconnect";
}
else
{
	popClient.DestroyConnection ();
	button1.Text = "Connect";
        // At this point the thread still isn't started (IsAlive is false)
	myThread.Abort ();
	myThread.Join ();
}


public void ThreadFunc ()
{// How can I use "popClient" in both main() and here in the threadfunc?	
Networking.PopClient popClient = new networking.PopClient (cboServer.Text, txtUser.Text, txtPassword.Text);

	bool bConnected = popClient.CreateConnection ();

	if (!bConnected)
	{
		lblError.Text = popClient.LastError;
		return;
	}

	int count = popClient.GetMailBoxCount ();
	int size = popClient.GetMailBoxSize ();

	lblMessageCount.Text = Convert.ToString (count);
	lblQuotaUsed.Text = Convert.ToString (size);
}
Like the comment there says, how can I use the popClient variable in both main and the threadfunc? So my other question (again like the comments say) is why isn't the thread started?

Thanks again for the help

- monrobot13
GeneralRe: Multi-Threaded Programming Pin
J. Dunlap8-Aug-03 9:49
J. Dunlap8-Aug-03 9:49 
GeneralBitBlt performance in C# Pin
CyberKewl7-Aug-03 16:52
CyberKewl7-Aug-03 16:52 
GeneralRe: BitBlt performance in C# Pin
J. Dunlap7-Aug-03 17:45
J. Dunlap7-Aug-03 17:45 
GeneralRe: BitBlt performance in C# Pin
CyberKewl7-Aug-03 21:21
CyberKewl7-Aug-03 21:21 
GeneralRe: BitBlt performance in C# Pin
Ista8-Aug-03 6:26
Ista8-Aug-03 6:26 
GeneralChanging a form's title Pin
eggie57-Aug-03 15:17
eggie57-Aug-03 15:17 
GeneralRe: Changing a form's title Pin
J. Dunlap7-Aug-03 15:20
J. Dunlap7-Aug-03 15:20 
GeneralRe: Changing a form's title Pin
eggie57-Aug-03 15:30
eggie57-Aug-03 15:30 
GeneralRe: Changing a form's title Pin
Rein Hillmann7-Aug-03 21:11
Rein Hillmann7-Aug-03 21:11 

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.