Jeremy Bell
Jeremy Bell

Reputation: 5293

How to determine at runtime when your C++ application has the visual studio debugger attached?

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.

Upvotes: 5

Views: 1583

Answers (2)

Nikola Smiljanić
Nikola Smiljanić

Reputation: 26863

Use IsDebuggerPresent

Upvotes: 4

unwind
unwind

Reputation: 400129

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

Upvotes: 14

Related Questions