Detecting Running IDE/Debugger 
Author Message
 Detecting Running IDE/Debugger

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



Tue, 05 Jul 2005 09:34:13 GMT  
 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



Tue, 05 Jul 2005 13:39:53 GMT  
 Detecting Running IDE/Debugger

Thanks Joe.


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");
>    }
> }

> int main(void)
> {
>  test();

>  return 0;
> }
> -------------------------------------------------

> Joe



Tue, 05 Jul 2005 14:36:47 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VS IDE freezing when I debug an application with debugger running

2. application runs outside the debugger, but cause the msdev.exe crashes when press F5 in IDE

3. application runs outside the debugger, but cause the msdev.exe crashes when press F5 in IDE

4. How to detect if a debugger is running?

5. Looking for Sample Code - Detecting if System Debugger is Running

6. Access violations in IDE debugger, works fine outside of IDE

7. Bug in IDE/Debugger regarding breakpoints (VC2003)

8. VC++ 7.0 Debugger/IDE Bug? std::string display

9. IDE and Debugger stop

10. Book on using VC++ 6 IDE and debugger?

11. Problem with Debugger/IDE in VC++6 Pro, NEED HELP PLEASE

12. dynamicaly invoke the IDE debugger for services

 

 
Powered by phpBB® Forum Software