* David Rigaudiere <[EMAIL PROTECTED]> [2007:08:30:22:47:29+0200] scribed:
> Hello Michael,
> your service is installed but it does not thing to do.
>
> You have to manage service manager events :
>
> use Win32::Daemon;
>
> Win32::Daemon::StartService(); # start service as soon as
> possible
>
> while( ($State = Win32::Daemon::State()) != SERVICE_STOPPED ) {
> if( $State == SERVICE_START_PENDING ) {
> Win32::Daemon::State( SERVICE_RUNNING );
> } elsif( $State == SERVICE_PAUSE_PENDING ) {
> Win32::Daemon::State( SERVICE_PAUSED );
> } elsif( $State == SERVICE_CONTINUE_PENDING ) {
> Win32::Daemon::State( SERVICE_RUNNING );
> } elsif( $State == SERVICE_STOP_PENDING ) {
> Win32::Daemon::State( SERVICE_STOPPED );
> } elsif( $State == SERVICE_RUNNING ) {
> # do something
> }
>
> sleep( 5 ); # little sleep for preserve resources
> }
>
> Win32::Daemon::StopService();
>
> Cheers.
> David Rigaudiere
<snip />Yes, I see what you are saying. I was confused about the POD and StartService, and callbacks ... A Windows Service is a service, is a service -- no ??? Is it NOT possible to start it from Windows Service panel? Your code example (above) makes NO reference to WHICH service; and I do not understand from the POD how to refer to which service. What am I missing? -- Best Regards, mds mds resource 877.596.8237 - Dare to fix things before they break . . . - Our capacity for understanding is inversely proportional to how much we think we know. The more I know, the more I know I don't know . . . --
signature.asc
Description: Digital signature
_______________________________________________ Perl-Win32-Users mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
