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

Need advice on synching up processes

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.


Nov 15 '05 #1
1 880
The thread being started should be connectToServer, not connectToCBE.

"LunchBox" <lu******@onlyonnewsgroup.com> wrote in message
news:uu**************@TK2MSFTNGP09.phx.gbl...
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(connectToServer));
}
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.


Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin Piper | last post by:
Hi all. I've recently landed myself the position of trainee C++ programmer which I'm extremely pleased about, but also nervous. According to the feedback from the interview, I have a good...
0
by: Eben Goodman | last post by:
I run a site that gets a fair amount of traffic throughout the day. For days at a time the site runs smoothly, and then, at seemingly random intervals I get the mysql error "Too many connections"....
4
by: Wayne Wengert | last post by:
I am looking for pointers to good beginner books, tutorials or other resources to help me understand how to really use XML data. I program mostly in VB (I have several applications in VB6 but am...
34
by: John Harrison | last post by:
An odd confession; an odd request; but here's the tale.... My company has a few PC systems which we have used for about 7 years and not updated - we've "made do", and besides, "if it ain't...
3
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
1
by: John | last post by:
Hi We have an access db which records daily orders. We would like the orders to be downloaded to a windows mobile 2003 device via usb cradle. Drivers then take along the device and get...
1
by: Jim Bancroft | last post by:
I have an aspx page that calls a component living in an out-of-process assembly; specifically, a dll that's hosted in a COM+ server package. Whenever I debug my page and hit a breakpoint on the...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
5
by: Zytan | last post by:
I know there's a DataGridView, but I think that's for synching the GUI to data in a SQL database. Is there anything simple like a slightly more complicated list box? Even if I could use a listbox...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.