Game Development Community

OpenWebBrowser() on Win98 fails

by Richard McKinney · in Torque Game Builder · 12/08/2006 (12:30 pm) · 2 replies

The call to RegOpenKeyEx() in Platform::openWebBrowser() in winWindow.cc is failing on Win98 with an ERROR_FILE_NOT_FOUND. I have no idea why and don't have time to find out, but changing the section to what follows resolves the issue:

if ( RegOpenKeyEx( HKEY_CLASSES_ROOT, dT("\http\shell\open\command"), 0, KEY_QUERY_VALUE, &regKey ) != ERROR_SUCCESS )
      {
         // We're failing on Win98 with an ERROR_FILE_NOT_FOUND.  Try the ShellExecute() method instead:
         Con::errorf( ConsoleLogEntry::General, "Platform::openWebBrowser - Failed to open the HKCR\http registry key!  Trying ShellExecute (open) instead.");
         return ((int)ShellExecute (NULL, "open", webAddress, NULL, NULL, SW_SHOWNORMAL) > 32);
      }

#1
12/08/2006 (1:21 pm)
I found the same problem earlier in the year and had a slightly different fix:

www.garagegames.com/mg/forums/result.thread.php?qt=43622
#2
12/08/2006 (5:29 pm)
I like your fix better :).