c++ URLDownloadToFile函数编译时出错,求帮助
c++吧
全部回复
仅看楼主
level 1
我想做个下载用的程序,但是编译时出了问题,求帮助
源代码:
#include <iostream>
#include <UrlMon.h>
#pragma comment(lib, "urlmon.lib")
using namespace std;
int main()
{
HRESULT hr = URLDownloadToFile(0, L"http//http://www.baidu.com/", L"D:\\baidu.html", 0, NULL);
if (hr== S_OK)
{
cout<< "ok"<< endl;
}
system("pause");
return 0;
}
问题:
C:\Users\Administrator\Desktop\Dev-cpp project\download\download.cppIn function 'int main()':
890C:\Users\Administrator\Desktop\Dev-cpp project\download\download.cpp[Error] cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'HRESULT URLDownloadToFileA(LPUNKNOWN, LPCSTR, LPCSTR, DWORD, LPBINDSTATUSCALLBACK)'
图片:
求c++大神帮助啊~
2016年12月23日 12点12分 1
level 11
去掉那个L
2016年12月23日 13点12分 2
level 9
DD
2016年12月23日 17点12分 3
level 9
DD
2016年12月23日 18点12分 4
level 9
DD
2016年12月23日 20点12分 5
level 9
DD
2016年12月23日 21点12分 6
level 9
DD
2016年12月24日 00点12分 7
1