Job Savers NT Service AppWizard

I wrote this wizard, not so much because NT Services are hard to write, but simply because they can be hard to debug if something is slightly wrong, so I figured I'd get the code right, and then automate it.

Instruction

This NT Service wizard is pretty simple to use, you only have to privide:
  • Internal name - Which should be unique, and not include spaces.
  • Display name - The string that you see in the list of the services manager.
  • Comments - You have to decide what level of source code comments you want.

Generated Code

The first thing you will want to do is build your new service, once thats done you can install it by typing:
  • myservice.exe install
Then later on you can remove it with:
  • myservice.exe remove me
The first thing everyone asks me when writting a new service is "What do I do now?" well, once you have your service code, you will add a thread to do the real work you want done, I normally create my threat in the bottom of serviceMain, and then put code in serviceHandler so that my thread gets started/stopped/paused on all the service control notifications.

Install/Uninstall

To install any wizard, you must simply copy the wizard (any .awx file) it to your devstudio/sharedide/template directory.
Conversly, to remove a wizard, simply deleting the .awx file from your template directory while DevStudio isnt running will do it.

Known Problems

You will see (and can ignore) the following warnings when compiling this code:
  • Command line warning D4024 : unrecognized source file type 'd', object file assumed
  • Command line warning D4027 : source file 'd' ignored

Download NT Service AppWizard - 12.9KB



Comments

  • Useful Wiz

    Posted by Legacy on 02/17/2000 12:00am

    Originally posted by: Jase Jennings

    Thanks for posting this wizard, it's been a godsend.
    It works well - no problems encountered other than the project settings switch as mentioned.

    Reply
  • NT service with 2000

    Posted by Legacy on 01/29/2000 12:00am

    Originally posted by: Ricardo

    The services that I created with these class would not start in 2000. Error message "Access deny" .
    
    Do yoy know why.

    Thanks ricardo

    Reply
  • The Known Problems For This Tool

    Posted by Legacy on 05/03/1999 12:00am

    Originally posted by: Xiangyang Liu

    The known problems described in the original post by Ben Knauss seems to be caused by an extra 'd' character inserted between the '/Fd' and the '/c' switches in the project settings generated by this tool.

    The problem goes away after I removed the 'd' character from the project settings manually.

    Reply
  • About the NT Service Appwizard

    Posted by Legacy on 04/28/1999 12:00am

    Originally posted by: Xiangyang Liu

    Thanks for providing such a wonderful tool. I was able to create my own NT services and I didn't even know what a NT service is last week!!!

    By the way, have you figured out what caused the warning messages described in your original post? It would be nice to get rid of those warnings.

    Thanks again.

    Reply
  • Wait till you see whats next

    Posted by Legacy on 04/28/1999 12:00am

    Originally posted by: Benjamin Knauss

    Active Directory Wizards, comming soon.

    Reply
  • Position under VC 6

    Posted by Legacy on 04/14/1999 12:00am

    Originally posted by: J�rg K�nig

    You're doing a great Job!

    under VC 6 this file must go to
    ...\Microsoft Visual Studio\Common\MSDev98\Bin\IDE

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

  • Savvy enterprises are discovering that the cloud holds the power to transform IT processes and support business objectives. IT departments can use the cloud to redefine the continuum of development and operations—a process that is becoming known as DevOps. Download the Executive Brief DevOps: Why IT Operations Managers Should Care About the Cloud—prepared by Frost & Sullivan and sponsored by IBM—to learn how IBM SmartCloud Application services provide a robust platform that streamlines …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds