URLDownloadToFile dont work in worker thread [modified]
-
URLDownloadToFile dont work in worker thread how do i make URLDownloadToFile work in a worker thread. because this is a blocking function, i got to use a worker thread when i call it. but unforturnately when i tried to use it in a thread it doesnt even work at all. its LRESULT return value becomes like -29581853 or something like that. also, the file never shows up in c:\abc.txt here is the code i used
download_result=URLDownloadToFile(NULL, yahoo_url, "C:\\abc.txt", 0, NULL);
how can i make it work in my worker thread? ref [url]http://msdn2.microsoft.com/en-us/library/ms918866.aspx\[/url\] using vc++6.0 winxp MFC STYLE -
URLDownloadToFile dont work in worker thread how do i make URLDownloadToFile work in a worker thread. because this is a blocking function, i got to use a worker thread when i call it. but unforturnately when i tried to use it in a thread it doesnt even work at all. its LRESULT return value becomes like -29581853 or something like that. also, the file never shows up in c:\abc.txt here is the code i used
download_result=URLDownloadToFile(NULL, yahoo_url, "C:\\abc.txt", 0, NULL);
how can i make it work in my worker thread? ref [url]http://msdn2.microsoft.com/en-us/library/ms918866.aspx\[/url\] using vc++6.0 winxp MFC STYLEMaybe you need to call CoInitializeEx() on your worker thread.
awah wrote:
its LRESULT return value becomes like -29581853 or something like that.
The exact value, preferrably in hexadecimal, would be much more helpful to us than "something like". :) Mark
Microsoft MVP - Visual C++