There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
black screen blue screen boot computer connection crash css dell display driver drivers error excel firefox firefox 3 game hard drive internet internet explorer itunes laptop lcd linux malware monitor network networking nvidia outlook outlook 2003 outlook express partition password printer problem problems ram router slow software sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
C++ code to run as a Windows Service ?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
deuce's Avatar
Computer Specs
Distinguished Member with 7,851 posts.
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mechanical Engineering Ninja
24-Jul-2008, 02: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!
__________________
Hey look--there it is again! It's the invisible hand of the market giving me the finger!


With a bit of luck, his life was ruined forever. Always thinking that just behind some narrow door in all of his favorite bars, men in red woolen shirts are getting incredible kicks from things he'll never know.

Remember what the dormouse said

Mike - Facebook me
deuce's Avatar
Computer Specs
Distinguished Member with 7,851 posts.
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mechanical Engineering Ninja
24-Jul-2008, 01: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.
Distinguished Member with 3,160 posts.
 
Join Date: Feb 2002
25-Jul-2008, 10:15 PM #3
Is there a reason not to use task scheduler for this?
deuce's Avatar
Computer Specs
Distinguished Member with 7,851 posts.
 
Join Date: May 2001
Location: Collegeville, Minnesota
Experience: Mechanical Engineering Ninja
27-Jul-2008, 04: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
Closed Thread

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.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:33 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.