[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Event ID: 7022, service hung on starting

Posted on 2004-11-18
7
Medium Priority
?
1,515 Views
Last Modified: 2013-11-20
Hi,

I try to create a windows service so my program will be run during the boot time.  Now I got this event message, "Event ID: 7022....The Server service hung on starting".  How can I debug to figure where exactly it is incorrect to cause this problem?  Any suggestion?  What will cause this problem??

Help please~~~


Xenia
0
Comment
Question by:xenia27
  • 4
  • 2
7 Comments
 

Author Comment

by:xenia27
ID: 12622644
How can I simple stop this event message not showing when I boot my computer????
Any suggestion?  How can I fix it???
0
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 12625813
When your service is starting, you need to report appropriate wait hints to the SCM and increase the dwCheckPoint member in your SERVICE_STATUS if the startup is a lengthy operation. And, you need to signal SERVICE_RUNNING at the end of the startup, e.g.

SERVICE_STATUS ssStatus;

    ssStatus.dwCurrentState      =      SERVICE_RUNNING;
    ssStatus.dwWin32ExitCode      =      0;
    ssStatus.dwWaitHint            =      0;

    // 'myStatusHandle' is returned by 'RegisterServiceCtrlHandler()'
    SetServiceStatus ( myStatusHandle, &ssStatus);





0
 

Author Comment

by:xenia27
ID: 12642190
I try this in my code...but not working...when I reboot, the message show still...
What should I do?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:jkr
ID: 12648414
>>What should I do?

Use a log file to track what your service is doing on startup. BTW, no need to reboot, you can just start/stop the service from the control panel.
0
 

Author Comment

by:xenia27
ID: 12650889
I cannot choose start/ stop the service through the control panel...the options are enabled.  What should I do?  What should I change while I set up my service???
0
 

Author Comment

by:xenia27
ID: 12663870
SERVICE_STATUS ssStatus;

    ssStatus.dwCurrentState     =     SERVICE_RUNNING;
    ssStatus.dwWin32ExitCode     =     0;
    ssStatus.dwWaitHint          =     0;

    // 'myStatusHandle' is returned by 'RegisterServiceCtrlHandler()'
    SetServiceStatus ( myStatusHandle, &ssStatus);

this actually work...but I put them into the wrong place...anyway, now it's working!!!  But I wonder why I cannot stop or start through the control panel...any idea???
0
 

Expert Comment

by:nfulford
ID: 26482856
I had the same problem with the server services not starting which was making the PC hand for about 15 minutes when logging in.

the cause of this was a new printer share!  Once i unshared the printer it was OK again.

Nick
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Screencast - Getting to Know the Pipeline
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question