Página 1 de 1

TWindowsService

Publicado: Vie Oct 26, 2007 2:03 am
por Nick Hilder
Hi Everyone
For a while I have wondered if I could create a xh windows service. I'm not
a very good programmer, let alone a C programmer
I did a little bit of googling and found this page
http://www.devx.com/cplus/Article/9857/1954?pf=true
It explains in very simple terms how to create a windows service in good old
C. It was simple enough that I could follow it
I then cranked up VS C# and made it create me a service so I could see the
class, it's methods etc.
I guess anyone who has written API wrapper (XA team plus others) will know
if I'm wasting my time pretty much straight away
I created the class below as I was reading various things. I would like to
have a crack at a bit of C and am wondering weather I'm wasting my time, ie
it's a much bigger fish than I realise.
Maybe someone with some C experience would/could help me along the way. My
only intention is to learn a bit of C etc, document the object and then
donate the code to the Xailer developers so it can hopefully be used by all
Xailer programmers.
Regards Nick
CLASS TWindowsService FROM TCompondent
PUBLISHED:
EVENT OnStart(oSender)
EVENT OnStop(oSender)
EVENT OnPause(oSender)
EVENT OnContinue(oSender)
PROTECTED:
PROPERTY cServiceName INIT ''
PROPERTY lCanStop INIT .T.
PROPERTY lCanPauseAndContinue INIT .F.
PROPERTY lCanShutDown INIT .T.
PROPERTY nExitCode INIT 0
PROPERTY cServiceStatus INIT SERVICE_START_PENDING
METHOD Initalise()
METHOD SetServiceStatus(cCurrentStatus)
PUBLIC:
METHOD Run()
ENDCLASS