?
Solved

debugging a service

Posted on 2004-11-08
2
Medium Priority
?
197 Views
Last Modified: 2010-04-24
I've downloaded some opensource code that runs as a service.  When I run it in the debugger, a messagebox pops up saying, "Not run as a service!"  Now, I'm no admin (just a humble coder), so I know only the basics about services.  I've looked some for info regarding installing services, but all I can find is code-based ways of installing a service.  I don't want to do that right now, I just want to debug it.  And, later on, when I'm done playing with it, I'd like to run it as a service.

So, two-part question.  Part one:  how do I debug this service in MSDev Visual C++.NET?  Part two:  once I finish playing, can I install it as a service any way OTHER than actually in the code?
0
Comment
Question by:rwinkler
2 Comments
 
LVL 16

Accepted Solution

by:
nonubik earned 1000 total points
ID: 12526016
Part one: a service starts after windows starts and before any user logging, so can't be debugged with Visual C++. NET. Only if it runs as process, and you can attach the debugger to that process (but you'll miss the starting part). http://msdn.microsoft.com/library/en-us/vccore/html/_atl_Debugging_Tips.asp

Part two: A service configuration program uses the CreateService function to install a service in a SCM database. So you can install the service by calling this function.
0
 
LVL 1

Author Comment

by:rwinkler
ID: 12786657
Sorry, I forgot about this question!  
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

571 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