Click here to Skip to main content
16,007,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: classview info not available Pin
ns13-Aug-02 5:40
ns13-Aug-02 5:40 
GeneralRe: classview info not available Pin
Bijesh13-Aug-02 6:21
Bijesh13-Aug-02 6:21 
GeneralRe: classview info not available Pin
Roger Allen13-Aug-02 5:26
Roger Allen13-Aug-02 5:26 
GeneralRe: classview info not available Pin
JT Anderson13-Aug-02 6:18
JT Anderson13-Aug-02 6:18 
GeneralRe: classview info not available Pin
Le centriste13-Aug-02 8:54
Le centriste13-Aug-02 8:54 
QuestionDebugging winodows services? Pin
clintsinger13-Aug-02 5:09
clintsinger13-Aug-02 5:09 
AnswerRe: Debugging winodows services? Pin
Tomasz Sowinski13-Aug-02 5:12
Tomasz Sowinski13-Aug-02 5:12 
AnswerRe: Debugging windows services? Pin
Daniel Lohmann13-Aug-02 5:50
Daniel Lohmann13-Aug-02 5:50 
The biggest problem with a service is, that you can not launch it from inside VStudio debugger because it has to be launched by the SCM. However, it is still possible to debug it:

If the service already has been started, you can connect a debugger via the task manager (right click on the process name and choose "Debug") or from the Debug/Attach to Process menu in VStudio. You can then load the source files and set breakpoints into the source.

However, if you have to debug the service startup code the above technique does not work because the service stops running even before you had a chance to attach the debugger. In this case it is useful to put a hardcoded breakpoint into the code, e.g. at beginning of your ServiceMain(). A hardcoded breakpoint is an software interrupt 3:

#define BREAK __asm int 3

Just put the BREAK statement at an appropriate place in your code. If the service is started via SCM an "unhandled exception" message appears. Choose cancel to start the debugger and voila - execution is halted at the position of BREAK.

On thing to keep into mind, because it may be confusing: If the service runs under another user account or LocalSystem (as almost any service), the debugger (VStudio) instance is also started under this user account. Therefore it might be that your user defined settings (shortcuts, toolbars, keyboard mapping, etc.) are not available.

--

Daniel Lohmann

http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there Big Grin | :-D )
GeneralTransferring CE Applications to the Desktop Pin
gm_coll13-Aug-02 5:08
gm_coll13-Aug-02 5:08 
GeneralRe: Transferring CE Applications to the Desktop Pin
Ancient Dragon13-Aug-02 14:50
Ancient Dragon13-Aug-02 14:50 
GeneralRe: Transferring CE Applications to the Desktop Pin
gm_coll13-Aug-02 22:27
gm_coll13-Aug-02 22:27 
GeneralRe: Transferring CE Applications to the Desktop Pin
Ancient Dragon14-Aug-02 0:07
Ancient Dragon14-Aug-02 0:07 
GeneralExporting to Excel, Powerpoint, etc.... Pin
Carlos Antollini13-Aug-02 4:26
Carlos Antollini13-Aug-02 4:26 
GeneralCFileDialog - Changing file types in runtime Pin
Ixion13-Aug-02 4:18
Ixion13-Aug-02 4:18 
GeneralFluid fast motion Pin
Vitaly Belman13-Aug-02 3:48
Vitaly Belman13-Aug-02 3:48 
GeneralRe: Fluid fast motion Pin
Brian Azzopardi13-Aug-02 3:52
Brian Azzopardi13-Aug-02 3:52 
GeneralRe: Fluid fast motion Pin
Tomasz Sowinski13-Aug-02 3:59
Tomasz Sowinski13-Aug-02 3:59 
GeneralRe: Fluid fast motion Pin
Jon Hulatt13-Aug-02 5:39
Jon Hulatt13-Aug-02 5:39 
Generalquick file question... Pin
Nitron13-Aug-02 3:34
Nitron13-Aug-02 3:34 
GeneralRe: quick file question... Pin
Tomasz Sowinski13-Aug-02 3:44
Tomasz Sowinski13-Aug-02 3:44 
GeneralTHANK YOU!!! Pin
Nitron13-Aug-02 3:58
Nitron13-Aug-02 3:58 
GeneralRe: quick file question... Pin
Roman Fadeyev13-Aug-02 3:47
Roman Fadeyev13-Aug-02 3:47 
GeneralRe: quick file question... Pin
Christian Graus13-Aug-02 4:06
protectorChristian Graus13-Aug-02 4:06 
GeneralRe: quick file question... Pin
Space Ace13-Aug-02 4:16
Space Ace13-Aug-02 4:16 
GeneralRe: quick file question... Pin
Chris Losinger13-Aug-02 5:26
professionalChris Losinger13-Aug-02 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.