
Detecting Running IDE/Debugger
Quote:
> When I'm debugging under the VC6.0 IDE, I wish to programmatically
> detect if the code is running under VC6.0 IDE. I guess a generic
> detection of a running under "de{*filter*}" would suffice. Basically I
> want to force some testing variables only under the IDE condition. I
> don't want the test variables when I run the debug version of the exe
> directly. Something like this:
> #ifdef _DEBUG
> if (De{*filter*}Active()) {
> ... set test variables...
> }
> #endif
> Thanks in advance for any tips
Hector,
You could use the Win32 IsDe{*filter*}Present()
API function.
Here's a code fragment showing it's use:
-------------------------------------------------
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <stdio.h>
void test(void)
{
if (IsDe{*filter*}Present())
{
printf("de{*filter*} active\n");
}
Quote:
}
int main(void)
{
test();
return 0;
Quote:
}
-------------------------------------------------
Joe