|
-
Jan 9th, 2002, 05:35 PM
#1
Thread Starter
Frenzied Member
URLDownloadToFile
Every time I use URLDownloadToFile my program freezes until the transfer is done...I want it to just download, and let the user still do things...
and one other thiing, using URLDownloadToFile how can I get the percent finished?
Thanks
-
Jan 9th, 2002, 05:37 PM
#2
You could probably thread URLDownloadToFile(). The last parameter of that function is a function pointer that you can specify download status.
Z.
-
Jan 9th, 2002, 06:19 PM
#3
Thread Starter
Frenzied Member
good idea....thanks
Im not sure how to use that last parameter though
-
Jan 9th, 2002, 07:02 PM
#4
I looked at that post, and realized that the second part made no sense =).
Also, its not a function pointer, as I first thought. Its an Object, that inherits from IBindStatusCallback. Simply implement the OnProgress member function. There is lots of info in the MSDN.
Z.
-
Jan 10th, 2002, 03:01 AM
#5
PowerPoster
How about using API...
PHP Code:
HINTERNET hInet=NULL;
HANDLE hFile=NULL;
DWORD dwByteDownload=0;
char Buff[10240];
// Open a new instance of the Internet Access
hInet = InternetOpen("MyXML", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
if (hInet != NULL)
{
// Access the given URL
hFile = InternetOpenUrl(hInet, "http://www.yahoo.com", NULL, 0, INTERNET_FLAG_RELOAD, 0);
if (hFile != NULL)
{
memset(Buff, '\0', 10240);
InternetReadFile(hFile, &Buff, Sz, &dwByteDownload);
}
}
// Close all the used handle
InternetCloseHandle(hInet);
InternetCloseHandle(hFile);
regards,
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
|