Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to debug a service program?

Posted on 2001-08-23
10
Medium Priority
?
260 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 400 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
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 …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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