So, I am trying to just download a simple executable from the web, in specific MediaFire. The problem is all I can find on downloading files is UrlDownloadToFile(), even if I could get this to work, I hear it doesn't wait for the file to download completely, which is a problem for me... I don't want to use a library such as LibCurl or something. I did have a program which did exactly this, about 4 months ago. I deleted it by mistake and when I came back to look for it, I found I deleted it, and Recuva can't find it... So can someone point me to where I can download a file in C++, or just show me a solution to make UrlDownloadToFile() wait for the file to download...
From what I just read (never used UrlDownloadToFile() befre), that function should download the whole file. Looks like it uses a callback to signal that the file has been downloaded completely.
I just don't like using them, all the linking and everything is not worth the bulk it will add to the project. If I have to use one though, I know how to link them.
EDIT::
By bulk, besides all the extra headers and stuff it adds, I also mean, why would I use LibCurl, a huge library full of things I won't use. All I need is to download a file, and LibCurl has so many more things then that, why download it for one out of hundreds of functions?
... I hear it doesn't wait for the file to download completely
Who told you that? The download progress is reported to you by the "OnProgress()" method from the IBindStatusCallback Interface you pass this function as the fifth argument. What is the issue that you are having with this function?
Downloading from file sharing sites like mediafire.com means you need to get session cookies from original HTML page, parse the response and possibly find unique download link there (at least for free accounts).
URLDownloadToFile has no way of doing this, so it's more or less useless. libcurl will do an excellent job here.
Of course, if you don't want external libraries (to me that means 'don't know how to use it :)' ) there is an option to use winsock, WinHTTP or WinInet APIs instead.
... I hear it doesn't wait for the file to download completely
That's true, if you don't use IBindStatusCallback and pass NULL instead it will work asyncronuously.