Solved

How to debug a service program?

Posted on 2001-08-23
10
252 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

752 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