CoderSource.net
Search
Re: Progress bars
Started by theDentist at 05-19-2006 9:50 AM. Topic has 5 replies.

Print Search « Previous Thread Next Thread »
   05-19-2006, 9:50 AM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Progress bars

Hi all,

Can anyone tell me how to program a progress bar to display the progress of, for example, a CopyFile function or uploading a file by FTP to an internet server. Is multi threading needed as two processes are going on at the same time.

Peter


   Report 
   05-19-2006, 12:21 PM
Yasir is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Progress bars
Hi peter

I think you need to user Timers Use a timer to handle it Create a time for say 500 milli seconds and then mention its handler function.

In the handler function increase the progress of progress control bar.

I think you dont need use threads.
If you have any confusions u r welcome to ask

Best Regards
-Yasir
   Report 
   05-19-2006, 1:10 PM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Progress bars

Hi,

Thanks Yasir, I'll give it a try, that does seem logical.

Regards

Peter


   Report 
   05-28-2006, 6:07 AM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Progress bars

Hi,

I've coded as you have said Yasir, but my computer must have a problem with multitasking (Like me! Tongue Tied [:S]), it seems to finish the FTP function before the timer kicks in and moves the progress bar, despite the SetTimer() function being called in advance of the FTP function.  It fails to trigger the timer event as well as processing the FTP event, it's either one or the other, not both at the same time.   Any ideas?  Or is it multi threads I need.

Peter


   Report 
   05-29-2006, 12:30 AM
Yasir is not online. Last active: 11/16/2006 10:02:40 AM Yasir

Top 10 Posts
Joined on 03-15-2006
Posts 44
Re: Progress bars
Sorry.
onTimer call with block your other application for some time and its not called in multithreading way but it automatically generate event after specific time. So what you can do is create a seprate thread for upload a file on FTP.


   Report 
   05-29-2006, 10:01 AM
theDentist is not online. Last active: 1/5/2008 4:01:46 PM theDentist

Top 10 Posts
Joined on 12-05-2005
Posts 42
Re: Progress bars

Thanks Yasir, I give it a try   Indifferent [:|]

Regards,

Peter


   Report 
Codersource.Net » Programming » MFC Programming » Re: Progress bars

MENU
Home
MFC 
C++
.Net
WIN32
Programming
Forum
My Articles
Welcome to Codersource.Net Login | Register | Faq  

Google
 

NOTES:


Thanks for visiting our CoderSource.net. This site will be improved with more articles. Interested visitors can also submit their articles through the Submit Article link.Your article will also be published after due consideration by the editor. 

© Copyright 2003. All rights on content reserved by CoderSource.net. Contact    About Us