How to Debugging Service Application in Delphi

You can debug service applications by attaching to the service application process when it is already running (that is, by starting the service first, and then attaching to the debugger). 

To attach to the service application process, choose RunAttach To Process, and select the service application in the resulting dialog. 

In some cases, this approach may fail, due to insufficient rights. If that happens, you can use the Service Control Manager to enable your service to work with the debugger:

To debug:

1  . First create a key called Image File Execution Options in the following registry location:
   HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  
2 . 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 bds.exe as the string value.

3 . In the Services control panel applet, select your service, click Startup and check Allow Service to Interact with Desktop.




     

No comments:

Post a Comment

Pages