]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/sockets/server.cpp
fix typo in an example (patch 1837973)
[wxWidgets.git] / samples / sockets / server.cpp
index 4904c662fc829abee027d2d8e8069aa32e4f9e3f..452e3dcc8a5072b92623a641734568a2480a2974 100644 (file)
 // headers
 // --------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(__APPLE__)
-#  pragma implementation "server.cpp"
-#  pragma interface "server.cpp"
-#endif
-
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
 
@@ -96,11 +91,11 @@ private:
 enum
 {
   // menu items
-  SERVER_QUIT = 1000,
-  SERVER_ABOUT,
+  SERVER_QUIT = wxID_EXIT,
+  SERVER_ABOUT = wxID_ABOUT,
 
   // id for sockets
-  SERVER_ID,
+  SERVER_ID = 100,
   SOCKET_ID
 };
 
@@ -128,6 +123,9 @@ IMPLEMENT_APP(MyApp)
 
 bool MyApp::OnInit()
 {
+  if ( !wxApp::OnInit() )
+      return false;
+
   // Create the main application window
   MyFrame *frame = new MyFrame();
 
@@ -175,7 +173,11 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY,
                            wxTE_MULTILINE | wxTE_READONLY);
 
   // Create the address - defaults to localhost:0 initially
+#if wxUSE_IPV6
+  wxIPV6address addr;
+#else
   wxIPV4address addr;
+#endif
   addr.Service(3000);
 
   // Create the socket