Wt examples  3.2.3
/home/koen/project/wt/public-git/wt/examples/hangman/hangman.C
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2011 Emweb bvba, Heverlee, Belgium
00003  *
00004  * See the LICENSE file for terms of use.
00005  */
00006 
00007 #include <Wt/WApplication>
00008 #include <Wt/WServer>
00009 
00010 #include "HangmanGame.h"
00011 #include "Session.h"
00012 
00013 Wt::WApplication *createApplication(const Wt::WEnvironment& env)
00014 {
00015   Wt::WApplication *app = new Wt::WApplication(env);
00016   
00017   app->setTitle("Hangman");
00018 
00019   app->messageResourceBundle().use(app->appRoot() + "strings");
00020   app->messageResourceBundle().use(app->appRoot() + "templates");
00021 
00022   app->useStyleSheet("css/hangman.css");
00023 
00024   new HangmanGame(app->root());
00025 
00026   return app;
00027 }
00028 
00029 
00030 int main(int argc, char **argv)
00031 {
00032   try {
00033     Wt::WServer server(argv[0]);
00034 
00035     server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
00036     server.addEntryPoint(Wt::Application, createApplication);
00037 
00038     Session::configureAuth();
00039 
00040     if (server.start()) {
00041       Wt::WServer::waitForShutdown();
00042       server.stop();
00043     }
00044   } catch (Wt::WServer::Exception& e) {
00045     std::cerr << e.what() << std::endl;
00046   } catch (std::exception &e) {
00047     std::cerr << "exception: " << e.what() << std::endl;
00048   }
00049 }

Generated on Thu Nov 1 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1