If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Sickboy
Experienced Solver
Posts: 91 Joined: Wed Mar 16, 2005 10:30 pm
Location: Germany
Post
by Sickboy » Sat Mar 22, 2008 11:57 pm
I can compile and install the service without problems but i'm not sure where to place my methods.
I tried it in line 41:
Code: Select all
...
// INIT THE REAL SERVICE HERE AND LET THE MAIN LOOP RUN
while(true)
{
wxSleep(2);
::wxBell();
}
...
But if i start the service, the "Service Startup Dialog" doesn't disappear and the startup timed out after a while with the
error 1053 .
The same happen if i put the while loop into the
int MainApp::OnRun() .
I've also removed the
SERVICE_INTERACTIVE_PROCESS in the
MainApp::Install(void) method, reinstalled the service, without success.
Any idea what i'm doing wrong ?
thx,
Stefan
evstevemd
Part Of The Furniture
Posts: 2409 Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Post
by evstevemd » Mon Apr 19, 2010 5:33 pm
Link is broken, can you fix it?
Chief Justice : We have trouble dear citizens!
Citizens : What it is his honor?
Chief Justice :Our president is an atheist, who will he swear to?
Gnawer
Experienced Solver
Posts: 65 Joined: Thu Jun 29, 2006 11:10 am
Location: Ahlen, Germany
Post
by Gnawer » Mon Oct 19, 2015 11:22 am
Great Code!
I was able to create a service that handles socket events.
A last problem I have to solve: an administrator launches Service Control Manager and stops the service.
This event can be catched by "WaitForSingleObject" method, so I read in MSDN.
But I want to catch it by a wx Event handler, same way as socket events.
wxEVT_END_SESSION etc. does not work.
Did anybody make it already?
Best regards
Gnawer
evstevemd
Part Of The Furniture
Posts: 2409 Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Post
by evstevemd » Mon Oct 19, 2015 1:36 pm
If you know how to do it in MSDN way then catch it and create new custom event which you can dispatch it using wxPostEvent
Chief Justice : We have trouble dear citizens!
Citizens : What it is his honor?
Chief Justice :Our president is an atheist, who will he swear to?
doublemax
Moderator
Posts: 19164 Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2
Post
by doublemax » Mon Oct 19, 2015 2:02 pm
BTW: There was a more recent post about creating a Windows service with wxWidgets.
Maybe it helps:
viewtopic.php?f=10&t=41497
Use the source, Luke!