What's the most robust (and portable across browser types) technique for a VC++ program to
cause the end user's Win95 PC default browser to load a URL? I have used the following code
to do this, but have experienced that some end users report a problem that their browser
(either IE or Netscape) pop up an error message stating that the page cannot be loaded
even though the URL can be loaded "manually" by the user.
void show_url(const char* url)
if (spawnl(_P_DETACH, command, "rundll32.exe", "url.dll,FileProtocolHandl
er", url, (const char*) NULL) == -1)
// print error message
I've also seen the following code fragment used in an example on Microsoft's web site:
ShellExecute (GetDesktopWindow(), "open", "http://www.microsoft.com/
", NULL, NULL, SW_SHOW);
Any feedback or experience in a robust technique to perform this task would be appreciated.