473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

What are the possible events in Windows Services

Hi

Im making a services that will log every time it gets started and stopped. I have accomplished that easily, using the onstop and onstart events.

Now, im trying to call an exe file that writes something on the log. im calling the exe file every 30 minutes, so i used a do while loop and a thread.sleep code. Now, I've put the loop inside the onstart event, i noticed that since its an infinite loop, the process never leaves the onstart event, and the services status is alway "starting".

Are there other events on windows services where i can put my code?

Thanks in advance. . .
May 16 '11 #1

✓ answered by Banfa

No, in the onstart event you are supposed to create a thread that performs the operation of the service, onstart should then exit.

The onstop event should then be used to stop this thread.

1 1109
Banfa
9,065 Expert Mod 8TB
No, in the onstart event you are supposed to create a thread that performs the operation of the service, onstart should then exit.

The onstop event should then be used to stop this thread.
May 16 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill Sonia | last post by:
I'm written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that once my send mail code is...
0
by: herbert | last post by:
What is the purpose/advantage/disadvantage of running multiple Windows Services in the same process? (defining ServicesToStart = ... in the first service class) I found one hint saying "this...
1
by: trialproduct2004 | last post by:
hi all can someone tell me difference between windows services and web services. I have created window services. As far as i know windows services doesn;t have any UI it starts executing as soon...
8
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my...
1
by: Jack David | last post by:
I need direction on how to create a program that will start multiple windows services. Each service will monitor a specific directory using FileSystemWatcher. I have the file system watcher part...
4
by: Serg | last post by:
Is it possible to create Windows Services that executes other applications (batch files), checks for newer versions (placed to a specific folder) and terminates them by demand (or as scheduled or...
2
by: Chris Podmore | last post by:
I don't know if this is the correct newsgroup but I couldn't find one for Windows Services Is it possible to check that a Windows Service is still running from another machine The idea being a...
5
by: Larry | last post by:
Hi, I am a newcomer to VC++ (specifically programming on Microsoft platforms); and I have a very basic question about windows services. Using Windows Services mechanism is it possible to...
4
by: Dica | last post by:
we just ordered VS 2005 standard edition. i was reading up on creating windows services and apparently this is only possible with the enterprise edition. is this true, or does it simply mean...
5
by: =?Utf-8?B?dmlzaHJ1dGg=?= | last post by:
This code works fine in Windows Application. In Windows Application, I am able to zip the image files properly and it totally contains 900MB My problem is the same code which I used in my Windows...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.