Solved

How to debug a service program?

Posted on 2001-08-23
10
255 Views
Last Modified: 2013-12-03
I write a background program,then transfer to a server program, but the running result is quite different.
Anyone can tell me how to debug a server program.
My develop env is Win2000+sp2, Vc6.0 + sp5

Many thanks.

0
Comment
Question by:choudes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 6

Expert Comment

by:MichaelS
ID: 6417177
Well, try to use Attach to process from VC6.0 but I am not sure that it's possible. Probably you have to use some other debugers. Also remote debug could help, I hope.
0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 100 total points
ID: 6417209
open up Visual Studio and Build/Start Debug/Attach to process

a dialog will open and you may have to check the show system processes - select your app  and debug away.

also make sure the .pdb is in the same directory as the .exe and that the source is readily available
0
 
LVL 86

Expert Comment

by:jkr
ID: 6417256
See http://support.microsoft.com/support/kb/articles/Q98/8/90.ASP ('HOWTO: Debug a Service Under Windows NT')
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 32

Expert Comment

by:jhance
ID: 6418223
Two ways that I've used:

1) The Visual Studio built-in debugger with the ATTACH feature as noted already.  Be sure to use a DEBUG build or debugging is pretty difficult...

2) SoftICE is really helpful in this case.  It's not cheap but it you do quite a bit of service debugging it can pay for itself quickly.
0
 
LVL 9

Expert Comment

by:BeyondWu
ID: 6420924
I think the service process will not appear in the attach process of VC.

Of couse, you can use SoftICE, but if you haven't installed it.
you can try following methods:
1. Open "Task Manager", select "Process" tab, select your service name, click right button it will popup a menu, select "debug", the default debuger will be invoke(VC), then open the source code in VC and set breakpoints.

2. Add DebugBreak() at servicemain or winmain, so you can debug from the beginning of your code.

Good Luck
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6421035
> I think the service process will not appear in the attach process of VC.

it does if you click the little check box :)
0
 
LVL 86

Expert Comment

by:jkr
ID: 10582783
I think I learned about a MSKB article in this thread that addresses this very issue :o)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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