Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

C++ code to run as a Windows Service ?


(!)

deuce's Avatar
Computer Specs
Member with 7,530 posts.
THREAD STARTER
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mech. Engineering Ninja
24-Jul-2008, 01:43 AM #1
C++ code to run as a Windows Service ?
Hi,

I have some C++ code that I'm developing that I need to run as a windows service. (I think)

First it might make sense to explain this a bit--maybe someone has a better idea on how to implement this.


I need an application that will read data from a specific file ( YYMMDD(-1).txt That is to say, a text file named with the above date format, but with yesterday's date) everyday at noon.

I need it to check the file for certain conditions (the conditions are a result of certain things the operator needs to be doing). If the conditions are not there, I need it to generate a plain text email to a certain email address.



I figure the way to do this is to write a program and run it as a windows service--so it is always running, wakes up at noon, does it's business and sleeps until the next day at noon. If anyone has a better idea, I would love to hear it.


With that said, in terms of getting C++ code to run as a windows service, can someone give me some direction in finding good info to help with this? It's been a few years since the last time I did a lot of programming, but I think I can handle the C++ code to do what I want. I just have no idea how to setup a windows service. I have searched the internet and read some things, but I haven't hit the ground runnning yet.

These two articles were very informatitive:

http://www.developer.com/net/cplus/a...0919_3293351_1

http://msdn.microsoft.com/en-us/library/ms810429.aspx

but I don't seem to have the same wizards as they do in my Visual Studio 2008. (didn't notice which complier (VS version) they used for their examples)


Maybe it's just really late and I'm missing it and I should go home...but I can't seem to get the ball rolling. Any help would be appreciated.

Going home and sleeping sounds nice--I think I'll do that in the mean time.



By the way:

I am using:
Visual Studio 2008 Professional on my desktop at home
Visual C++ 2008 Express on my workstation at work

I am using XP Pro (x86) on my workstation
The code will be implemented on a workstation running XP Pro (x86)


Thanks!
deuce's Avatar
Computer Specs
Member with 7,530 posts.
THREAD STARTER
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mech. Engineering Ninja
24-Jul-2008, 12:36 PM #2
Also--can this be done in Visual C++ 2008 Express? Is this something that I need to stick to VS Pro for?

Thanks!
IMM's Avatar
IMM IMM is offline IMM is authorized to help remove malware.
Malware Removal Specialist with 3,259 posts.
 
Join Date: Feb 2002
25-Jul-2008, 09:15 PM #3
Is there a reason not to use task scheduler for this?
deuce's Avatar
Computer Specs
Member with 7,530 posts.
THREAD STARTER
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mech. Engineering Ninja
27-Jul-2008, 03:17 PM #4
Quote:
Originally Posted by IMM View Post
Is there a reason not to use task scheduler for this?
I forgot about that component in the control panel.

I might be able to use it--it would make my code easier to write.

Can I develop my C++ code, compile it as a .exe and set it up with the task scheduler?


Thanks,
Mike
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑