Index   Commented   Search   About

Debugging a Service

You can use the following methods to debug your service.

  • Many debuggers allow you to debug a running service. First, obtain the process identifier (PID) of the service process. This information is available from the PView application. After you have obtained the PID, attach to the running process. For syntax information, see the documentation included with your debugger.

  • Call the DebugBreak function to invoke the debugger for just-in-time debugging.

  • Windows NT also allows you to specify a debugger to use when starting a program. Create a key called Image File Execution Options in the following registry location:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion

Create a subkey with the same name as your service (for example, MYSERV.EXE). To this subkey, add a value of type REG_SZ, named Debugger. Use the full path to the debugger as the string value. In the Services control panel applet, select your service, click Startup and check Allow Service to Interact with Desktop.

Note To debug the initialization code of an auto-start service, you will have to temporarily install and run the service as a demand-start service.

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun