Wt examples  3.3.0
hangman.C
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium
3  *
4  * See the LICENSE file for terms of use.
5  */
6 
7 #include <Wt/WApplication>
8 #include <Wt/WServer>
9 
10 #include "HangmanGame.h"
11 #include "Session.h"
12 
14 {
15  Wt::WApplication *app = new Wt::WApplication(env);
16 
17  app->setTitle("Hangman");
18 
19  app->messageResourceBundle().use(app->appRoot() + "strings");
20  app->messageResourceBundle().use(app->appRoot() + "templates");
21 
22  app->useStyleSheet("css/hangman.css");
23 
24  new HangmanGame(app->root());
25 
26  return app;
27 }
28 
29 
30 int main(int argc, char **argv)
31 {
32  try {
33  Wt::WServer server(argv[0]);
34 
35  server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
37 
39 
40  if (server.start()) {
42  server.stop();
43  }
44  } catch (Wt::WServer::Exception& e) {
45  std::cerr << e.what() << std::endl;
46  } catch (std::exception &e) {
47  std::cerr << "exception: " << e.what() << std::endl;
48  }
49 }

Generated on Fri May 31 2013 for the C++ Web Toolkit (Wt) by doxygen 1.8.3.1