Opening a url with the default browser

closed account (42hU7k9E)

I want to know if there is a way that I can open urls through the program.
I have the urls saved in a stack as strings. I tried the function ShellExecute,
but it doesnt work if you put the string as a parameter of the function.

This works:
ShellExecute(NULL, "open", ", NULL, NULL, SW_SHOWNORMAL);
This doesn't:
ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);

Any thoughts?
I think the url needs to be a cstring, not a std::string... try url.c_str()

-- edit: I think it's also supposed to be a wide char too, but try that first
Last edited on
Topic archived. No new replies allowed.