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:
However, when I compile, I get this:
HRESULT hr = URLDownloadToFile( NULL, L"http://www.url.com/image.jpg", L"image.bmp", 0, NULL );
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?
error C2664: 'URLDownloadToFileA' : cannot convert parameter 2 from 'const wchar_t ' to 'LPCSTR'