I am very interested in TWinService and so also WinService sample program. I have compiled and run the WinService sample and it gives me the four buttons which all seem to do what they should.
I have taken a copy of the folder and want to make it try to make the service actually do something by adding to the ServiceMain() fuction in start.prg.
I do something like this to understand what is happening .... I get logging from the first line of the Procedure, but no other logging or beep?
STATIC PROCEDURE ServiceMain( oSender )
LogFile( "ServiceMain(1)" + " : " + Time()) // THIS DOES WRITE TO LOGFILE ..... GOOD
DO WHILE oSender:nStatus == ssRUNNING
/*
[ENGLISH]
Here you can do anything

FYI: You should allow the loop to continue, leaving a short pause (i.e. 1 second) to avoid the system to lock
[SPANISH]
Aquí puede poner lo que necesite
NOTA: Siempre debe permitir que el bucle continue, dejando una pequeña pausa (p.ej. 1 segundo) para evitar bloquear el sistema
*/
LogDisplay( "ServiceMain(2) : In ssRunning loop" ) // I DO NOT SEE THIS LINE
Beep( 2000 ) // I DO NOT HEAR THIS BEEP
ProcessMessages()
ENDDO
LogFile( "ServiceMain(3)" + " : " + Time()) // I DO NOT SEE THIS LINE
RETURN
It is quite possible that I am not understanding something!!
Any help would be appreciated.
Thank you.
Chris