-
March 14th, 2011, 09:10 PM
#1
Function delay
I have to download a text file from my web server then call a read function that uses ifstream. Both work separately with no problems but when I try to get them to work together it fails miserably. The read function can't do its job unless the file has been downloaded, so I put URLDownloadToFile() first in the execution. Once the file is downloaded the next thing is read opens and reads the file. What I'm trying to do is have this in a continuous loop. I tried the nested for loop method..
Code:
for(int i = 0; i < 100; i++){
read()
for(int j = 0; j < 50; j++){
URLDownloadToFile() }
}
But when I add it to the bottom of my code right before the return 0, it compiles fine, but it never executes in run time. Maybe because I have 8 threads starting above the code but I don't see how that could affect it. Any suggestions? If I left something out let me know, Thanx.
-
March 15th, 2011, 04:04 AM
#2
Re: Function delay
You need to check the download status by LPBINDSTATUSCALLBACK and when finished just open and read the file.
URLDownloadToFile just returns S_OK on successfully starting of download but not indicating the finish line.
◄◄ hypheni ►►
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|