Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

Problems with URLDownloadToFile() function

$
0
0

#include <tchar.h>
#include <urlmon.h>
#pragma comment(lib, "urlmon.lib")
int main()
{
HRESULT hr = URLDownloadToFile(NULL, _T("http://bit.ly/16LX38r"), _T("c:/sample_image.gif"), 0, NULL);
return 0;
}

This program is supposed to download the file from http://bit.ly/16LX38r and save it to c:/sample_image.gif, but when i run it, it exits and does not create thesample_image.gif file. Why it doesn't work properly and how can i fix it?


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>