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

TWindowsService

Publicado: Vie Oct 26, 2007 10:13 am
por ignacio
Nick,
Try this free tool:
http://sourceforge.net/projects/uws/
I hope it helps.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Nick Hilder" <nick_Nospam#$%@capsol.com%NOSPAM%.au> escribió en el mensaje
news:[email=47212eb4@ozsrv2.ozlan.local...]47212eb4@ozsrv2.ozlan.local...[/email]
> 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
>
>

TWindowsService

Publicado: Vie Oct 26, 2007 10:13 am
por NoName
Nick,
Try this free tool:
http://sourceforge.net/projects/uws/
I hope it helps.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"Nick Hilder" <nick_Nospam#$%@capsol.com%NOSPAM%.au> escribió en el mensaje
news:[email=47212eb4@ozsrv2.ozlan.local...]47212eb4@ozsrv2.ozlan.local...[/email]
> 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
>
>