![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Preventing Timeout Message During Long Processes
So currently I am working on a program to backup files. What it does is search through each directory recursively like so:
vbnet Syntax (Toggle Plain Text)
|
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
maybe try putting it in a new thread and see what happens
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
What do you mean? Like have something that starts a new thread for each sub folder? If so how would I go about doing that? and What if that folder has 1000 files in it too?
|
|
|
|
|
|
#4 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 730
Rep Power: 4
![]() |
Is this function running on the main thread (it is if you didn't create any) in a WinForms app?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#5 |
|
Hobbyist Programmer
|
it's a windows from, here is all the code:
vbnet Syntax (Toggle Plain Text)
|
|
|
|
|
|
#6 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 730
Rep Power: 4
![]() |
The Click event is called from the message loop. Control will not return to the message loop until BackUp returns, and it's going to take a while. Since the form can not process messages until then, you cannot interact with it and it will shortly be reported as unresponsive as a result of the queue filling up. The best solution would be to move the backup operations to a separate thread. Look in to the BackgroundWorker component. You will of course need to be wary of synchronization issues.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| GOTO Sys. Tray Src. (code Snippet) | Cipher | Show Off Your Open Source Projects | 1 | Oct 17th, 2006 1:38 PM |
| Compiling Maverik 6.2 (from C) | megamind5005 | C | 16 | May 3rd, 2006 5:41 PM |
| visual basic pixel image comparison | youngnoviceinneedofhelp | Visual Basic | 3 | Mar 19th, 2006 1:57 PM |
| Jackpot game | zorin | Visual Basic | 3 | Jun 10th, 2005 1:19 PM |