views:

68

answers:

2

How do you determine at runtime whether the visual studio debugger is attached to your process. I've seen instructions for how to do this in .NET, but my process is a native C++ process. Support for detecting Just-in-time debugging would be nice but not a strict requirement.

+8  A: 

The Win32 call IsDebuggerPresent() sounds like it ought to work.

unwind
Thanks. That's exactly what I needed.
Jeremy Bell
+3  A: 

Use IsDebuggerPresent

Nikola Smiljanić
+1 for being the right answer, even if 2 minutes later than unwind's answer. Thanks to you also.
Jeremy Bell