Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use VFP exe as NT service , How to detect service stop request in prog

Status
Not open for further replies.

mengzs

MIS
Jul 23, 2001
17
US
Hi there,
I have a VFP EXE runing as a service in NT server. I want to detect the stop-service request from either NT or User, so I can do clean up.

Thanks
 
When the program starts create a table called requests
When someone requests a service add a record, and leave the records open,

When the request is completed either deleted aor datetime stamp the record as completed.

When the program shuts down, delete the table.

Write a program that monitors the directory for this table.
If table exist, NT service is not running
If Table has no records, No open client requests.
David W. Grewe
Dave@internationalbid.com
 
Thanks for reply.

My question is that the NT service(VFP EXE) is automatically run whenever the server is up. If someone go to "Control panel/Service" to stop my service(VFP EXE), how can I have know this kind stop-service request ? or If someone "End Task" on my service, How the program can detect it and accept or refuse the request ?
 
This should be "trapped" by an ON SHUTDOWN routine, but I've never run a VFP app as a service, so I don't know for sure.

Rick
 
"on shutdown" wouldn't work.

I am useing "SRVANY.EXE" for "VFP EXE" as an NT service.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top