![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Yes but now there is agraham's Threading library Threading library for optimising compiler
You can run ftp commands in a seperate thread using Thread object. In your main thread add a timer and check the filesize of the file you are downloading FileSize(AppPath & "\big.zip") That's it! |
|
||||
|
Great idea, Dimitris. I'm having a small problem with the implementation, though.
I put the code that updates the progress bar into its own thread; it just crashes. Really not sure why. Have you done anything like this sucessfully? |
|
||||
|
Are you using thread events? I tried to explain in the help that you can't update graphic controls directly in code in a thread. You must fire a thread event to do the updating for you. See the example that updates a textbox from a thread - you must do the same.
|
|
||||
|
I tried to have a look at the help file you provided before I satrted working with the .dll, but with no luck. The window hust diaplys 'Action Cancelled' whnever I pull up the 'Threading' help menu option.
So I'm tying to work entirely from the example code you provided. Yes, I put the .chm file into /basic4ppc/libraries. (I've got to find some time to try to write a .dll - that's just so cool to be able to add on to Basic4PPC!) Gary |
|
||||
|
That's very strange. I use the same template for all my help files and just modify it each time so there should be nothing different with that particular help file. It works fine for me, and I assume dzt who has tried the library. Are any other help files affected? I suggest a Google for "Help Action cancelled" it bought up a couple of things to check.
|
|
||||
|
Oops... I forgot that Windows XP's internal security can block files like this. The solution (for those who don't know) is to right-click the file and click 'Unblock'. Then the contents will display correctly.
Oh, and the error I was getting was a divide by zero when calculating the progress bar's value. Had nothing to do with threading. Now if I can just find my 'dunce' cap... So now my code is error-free but does not update the progress bar; as you say, GUI operations are not thread-safe. So I'm still looking for a solution that will update the progress bar during an ftp file download. I'm a beleiver that there's always a solution. Great library, by the way! Gary |
|
||||
|
Quote:
I can't think of anyway of monitoring the progress of a synchronous process other than what dzt suggested in post #3 i.e. monitor something that is changing from the main or another thread thread. In this case, as he suggested, the size of the downloading file. However as the file is presumably open during the download I don't know if the returned size would be anything other than zero until it is closed - nor indeed whether it would locked and inaccessible. Only a trial would tell. |
![]() |
| 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 |
| Change color in a progress bar | 2220 | Questions & Help Needed | 8 | 09-28-2008 10:58 AM |
| help with download file | Byak@ | Questions & Help Needed | 2 | 07-14-2008 07:14 PM |
| 'sprite' dragging (made progress but have new problems) | cpc6128 | Questions & Help Needed | 5 | 03-06-2008 01:51 PM |
| Low-level FTP upload with progress | brathbone | Open Source Projects | 3 | 02-10-2008 12:42 PM |
| Vertical Progress bar | davelew1s | Questions & Help Needed | 2 | 08-23-2007 07:09 PM |