debugging a service

Posted on 2004-11-08
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?
Question by:rwinkler
    LVL 16

    Accepted Solution

    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).

    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.
    LVL 1

    Author Comment

    Sorry, I forgot about this question!  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    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++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now