Browse Source

use a dialog when the port is unavailable

David Rose 21 years ago
parent
commit
591fd7c648
1 changed files with 8 additions and 1 deletions
  1. 8 1
      pandatool/src/win-stats/winStats.cxx

+ 8 - 1
pandatool/src/win-stats/winStats.cxx

@@ -104,7 +104,14 @@ int main(int argc, char *argv[])
   // Create the server object.
   // Create the server object.
   server = new WinStatsServer;
   server = new WinStatsServer;
   if (!server->listen()) {
   if (!server->listen()) {
-    nout << "Unable to open port.\n";
+    ostringstream stream;
+    stream 
+      << "Unable to open port " << pstats_port
+      << ".  Try specifying a different\n"
+      << "port number using pstats-port in your Config file.";
+    string str = stream.str();
+    MessageBox(toplevel_window, str.c_str(), "PStats error", 
+               MB_OK | MB_ICONEXCLAMATION);
     exit(1);
     exit(1);
   }
   }