Need advice on synching up processes

  • Thread starter Thread starter LunchBox
  • Start date Start date
L

LunchBox

I have a program that launches a dial up form so that a person can choose
which dial up entry to use. The problem I have is that I need the parent
form to wait until the dial up is connected before continuing on with the
tasks that require the connection. I'm trying to use threads to do this,
but I really am not very experienced with them

This is the event that is called when the person needs to synchronize:
private void menuItemSynchronize_Click(object sender, System.EventArgs e)
{
try
{
this.Cursor = System.Windows.Forms.Cursors.AppStarting;
if(!connected())//determines if the computer is already online
{
Thread conn = new Thread(new ThreadStart(connectToCBE));
}
doTasks();

This the method that launches the dial up dialog box:

private void connectToServer()
{
r.ShowDialog(this);//r is the dial up class
r.Dispose();
while(r.Status)// r.Status checks to see if r is connected
Thread.Sleep(0);
}

Any help is appreciated.
 
The thread being started should be connectToServer, not connectToCBE.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top