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

  • On-demand Event Event Date: September 10, 2014 Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild." This loop of continuous delivery and continuous feedback is how the best mobile …

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds