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

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • Instead of only managing projects organizations do need to manage value! "Doing the right things" and "doing things right" are the essential ingredients for successful software and systems delivery. Unfortunately, with distributed delivery spanning multiple disciplines, geographies and time zones, many organizations struggle with teams working in silos, broken lines of communication, lack of collaboration, inadequate traceability, and poor project visibility. This often results in organizations "doing the …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds