#include<iostream>
#include <windows.h>
#include<string>
using namespace std;
int main()
{
cout << "Opening Google...";
ShellExecute(NULL, L"open", L"https://www.google.com",NULL, NULL, SW_SHOWNORMAL);
return 0;
}
I get this error: Cannot convert 'const wchart_t*' to 'LPCSTR{aka const char*}\\ for argument '2' to 'HINSTANCE_*SHellExecuteA(HWND,LPCSTR,LPCSTR, LPCSTR, LPCSTR, INT)'
You have 2 capabilities:
You can use special macros for string literals for more flexibility
ShellExecute(NULL, TEXT("open"), TEXT(" https://www.google.com "), NULL, NULL,
SW_SHOWNORMAL);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.