Click here to Skip to main content
15,885,365 members
Articles / Desktop Programming / MFC
Article

Service wizard

Rate me:
Please Sign up or sign in to vote.
3.39/5 (20 votes)
21 Jan 20041 min read 108.5K   2K   43   30
Service wizard integrated with the Visual Studio IDE.

Image 1

Introduction

Service applications always have the same skeleton. Therefore, it would be nice to have a service wizard integrated with the Visual Studio IDE (Integrated Development Environment).

My service wizard was created by the "Custom Wizard" project type. Its output is an AWX file that should be copied to <Visual Studio directory>\Common\MSDev98\Template folder.

Therefore, when creating service projects, choose "Service Wizard" from the project type list.

One wizard step

As seen from the image above, there are 3 parameters for service installation:

  1. Displayed service name - This is the text that will be displayed when opening the service control manager.
  2. Startup type.
  3. Should the service interact with the desktop?

Install and uninstall your service

The wizard writes down code for installing and uninstalling your service. Running your executable with the '/Install' or '/Uninstall' parameter will install or uninstall the service, respectively.

Debugging your service

Since the created project (by the wizard) is a console application, you can debug your service as if it were just a console application and not a service.

TO DO ...

Your application code should be in the method Run() located in service.cpp file. Look for the comment // TO DO: Add code here. This is the place where the service is running.

Updates

  • 9.Apr.2003 - Send WM_QUIT message on service stop request.
  • 18.Jan.2004 -
    1. Start the service automatically when the service is installed and defined to have automatic startup.
    2. Wait for the service to be stopped when uninstalling the service.

Enjoy...

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralThe servise does not working on Vista Pin
coronys20-May-09 20:19
coronys20-May-09 20:19 
QuestionWhat is .awx file? Pin
G Haranadh30-Aug-05 8:46
G Haranadh30-Aug-05 8:46 
AnswerRe: What is .awx file? Pin
Dudi Avramov1-Sep-05 1:32
Dudi Avramov1-Sep-05 1:32 
GeneralRe: What is .awx file? Pin
G Haranadh1-Sep-05 9:55
G Haranadh1-Sep-05 9:55 
QuestionService description? Pin
Unimportant user with important question16-Jun-05 10:29
sussUnimportant user with important question16-Jun-05 10:29 
GeneralDifference between wizards Pin
Soron26-Jan-04 5:01
Soron26-Jan-04 5:01 
GeneralRe: Difference between wizards Pin
milkyhonglee3-Mar-06 3:39
milkyhonglee3-Mar-06 3:39 
GeneralThis is a trash, at least 80%+ are trash Pin
Anonymous22-Jan-04 4:44
Anonymous22-Jan-04 4:44 
GeneralRe: This is a trash, at least 80%+ are trash Pin
Dudi Avramov22-Jan-04 9:00
Dudi Avramov22-Jan-04 9:00 
GeneralRe: This is a trash, at least 80%+ are trash Pin
Soron26-Jan-04 5:06
Soron26-Jan-04 5:06 
GeneralNot working and stoping Pin
Aji Varghese6-Nov-03 22:20
Aji Varghese6-Nov-03 22:20 
GeneralRe: Not working and stoping Pin
Aji Varghese23-Dec-03 19:23
Aji Varghese23-Dec-03 19:23 
GeneralLogEvent... Pin
Matt Newman12-May-03 7:02
Matt Newman12-May-03 7:02 
GeneralRe: LogEvent... Pin
Dudi Avramov12-May-03 21:31
Dudi Avramov12-May-03 21:31 
GeneralRe: LogEvent... Pin
Matt Newman13-May-03 4:02
Matt Newman13-May-03 4:02 
QuestionVC7? Pin
Matt Newman9-May-03 16:39
Matt Newman9-May-03 16:39 
Any plans to update for VC7?

[EDIT]Unicode would be a nice feature too[/EDIT]

Matt
AnswerRe: VC7? Pin
Dudi Avramov10-May-03 21:05
Dudi Avramov10-May-03 21:05 
GeneralRe: VC7? Pin
Matt Newman11-May-03 3:49
Matt Newman11-May-03 3:49 
GeneralNot a good service skeleton Pin
WoutL6-Apr-03 20:56
WoutL6-Apr-03 20:56 
GeneralRe: Not a good service skeleton Pin
Dudi Avramov7-Apr-03 3:20
Dudi Avramov7-Apr-03 3:20 
GeneralRe: Not a good service skeleton Pin
WoutL7-Apr-03 3:31
WoutL7-Apr-03 3:31 
GeneralRe: Not a good service skeleton Pin
Dudi Avramov7-Apr-03 21:02
Dudi Avramov7-Apr-03 21:02 
GeneralRe: Not a good service skeleton Pin
WoutL7-Apr-03 21:13
WoutL7-Apr-03 21:13 
GeneralRe: Not a good service skeleton Pin
Dudi Avramov8-Apr-03 1:39
Dudi Avramov8-Apr-03 1:39 
GeneralRe: Not a good service skeleton Pin
WoutL8-Apr-03 2:15
WoutL8-Apr-03 2:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.