How to develop program to run as daemon?

gubak's Avatar, Join Date: Mar 2007
Newbie Member
Hi!

I have been debeloping in C++ Builder.
I want to develop an email alerter program for windows machine. This program will start at startup and every 5 seconds will ask the mail server for the new messages. If new message comes the email alerter program will start an animation.
I want it to run in daemon mode (work in background and listening new messages), but I have no idea how to do this. Maybe with an endless cycle? I think it's not very good idea.

Do you have any other idea how to develop a program to run in daemon mode?


Thank you
DaWei's Avatar, Join Date: Dec 2006
Team Leader
You either do it, or you don't. In the first case, it is a (albeit, possibly smalll) hit on performance. If this is a valuable hit, go for it. If not, fugeddaboudit.
boldyman's Avatar, Join Date: Mar 2007
Newbie Member
On windows a daemon is called "windows service".
Take a look at the MSDN:
http://msdn2.microsoft.com/en-us/library/8dy6h580(VS.80).aspx

Good luck!
DaWei's Avatar, Join Date: Dec 2006
Team Leader
A Windows service is an example of a daemon, or daemon-like operation. A daemon, such as is triggered by some interrupt, particularly a real-time interrupt, can run entirely outside the purview of any operating system that happens to be installed. One who is not intimately familiar with systems and their OS skins is courting potential disaster.

Last edited by DaWei; 1Apr2007 at 07:18..