Application Server in a Console

Liam Whalen lwhalen at cabletv.on.ca
Fri Oct 5 10:06:54 PDT 2007


I'm not sure if there are console specific ways to do this but you can do i=
t using wxApp.  As far as I can tell you will still need a wxWindow object =
to get the event handling properties started.  However you do not need to S=
how() this window, it mearly needs to exist.

So you get your wxWindow.  Use wxWindow::GetEventHanlder to pass the event =
handler to your object's (with wxSocketBase) constructor.  This object must=
 inherit from wxEvtHandler.

Then in your constructor for the object with a reference to wxSocketBase do=
 this:

theEventHandlerYouPassedToTheConstructor->Connect( wxEVT_SOCKET, wxSocketEv=
entHandler( TheObjectWhosConstructorYouAreIn::OnServerEvent ), NULL, this );
theEventHandlerYouPassedToTheConstructor->Connect( wxEVT_SOCKET, wxSocketEv=
entHandler( TheObjectWhosConstructorYouAreIn::OnSocketEvent ), NULL, this );

Then just define OnServerEvent and OnSocketEvent in this object.

Liam


  ----- Original Message ----- =

  From: Mauro Cordon =

  To: wx-users at lists.wxwidgets.org =

  Sent: Friday, October 05, 2007 10:35 AM
  Subject: Application Server in a Console


  Hi,


     I want to create a server of applications, but it must work in a conso=
le, but answers the events to the wxSocketBase.
     What can I do ? Use wxApp ? What send to SetEventHandler() ?
     I use wxGTK and wxMSW.

  -- =

  Mauro Cordon.=B7.   -)-----
  --------------------------------------------------------------- =

  mauro at scordon.com.br - mcordon at usa.com - mcordon at gmail.com
  Linux User #347961     ICQ ID #124551451     Orkut: Mauro Cordon =

  "Audaces Fortuna Juvat"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20071005/4ef=
7e2b6/attachment.htm


More information about the wx-users mailing list