int main() {
string url;
int a;
int b = 0;
cout << "Enter url: ";
cin >> url;
cout << "how many times do you want to open the url?: ";
cin >> a;
while (b<a)
{
ShellExecute(NULL, "open", url.c_str, NULL, NULL, SW_SHOWNORMAL);
b++
}
cin >> a;
}
//给我带来麻烦的那部分 是“开放部分说它不能转换// itShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT)”:不能将//参数2从'const char [5]'转换为'LPCWSTR'
答案 0 :(得分:1)
调用ShellExecuteA而不是ShellExecute,Windows API有大量的宏来决定ANSI和Unicode版本