Hi everyone,
I have the following code in my Win32 program which is supposed to download an image from the specified URL when I press the 'download' button, and then open it:
Code:
case IDC_DOWNLOAD:
HRESULT hr = URLDownloadToFile( NULL, L"http://www.url.com/image.jpg", L"image.bmp", 0, NULL );
system("image.bmp");
break;
However, when I compile, I get this:
Code:
error C2664: 'URLDownloadToFileA' : cannot convert parameter 2 from 'const wchar_t [69]' to 'LPCSTR'
I'm guessing that this is something to do with the fact that the URLDownloadToFile operation is only supposed to be used in console programs? How do I adapt it to work in Win32?
Thanks.