Re: How to tell if my VB6 program is running under the debugger
- From: "Auric__" <not.my.real@xxxxxxxxxxxxx>
- Date: 23 Aug 2007 21:39:54 GMT
On Thu, 23 Aug 2007 20:11:12 GMT, ImageAnalyst wrote:
How can I tell if my program is running under the VB6 IDE? I have
a program that has a calibration step that depends on some
equipment being attached (imaging rig, digital camera, etc.). I
don't have this equipment but my deployed systems do. I'd like it
to continue on despite failing calibration but only if I know it's
me (or someone) running the code under the debugging environment.
I'd like something like VB.Net has
System.Diagnostics.Debugger.IsAttached and you can do something
like: ' If we're running under the debugger, set the techSupport
flag to be true.
If System.Diagnostics.Debugger.IsAttached Then
' We're running in VS2005 debugging environment. It's us,
not our
users!
End If
Any such technique for VB6? Do I need to use some API call?
Regards,
ImageAnalyst
There *are* ways to determine whether or not you're in the IDE, but I
never bother with such things. For the few projects where I have such
worries, I just use two identical projects (xxx.vbp & xxx-
dbg.vbpwhich use the same source files) and set a conditional
compilation variable (I think that's what it's called; VB and my
projects are at home so can't check) in the project properties
Dbug = 1 for the debug project
Dbug = 0 for the release project
Then in the source code I do:
#if Dbug then
[...]
#else
[...]
#endif
(If you do this, don't use "Debug", since that's a reserved word.)
--
auric dot auric at gmail dot com
*****
Fuck with me and I convert your job into a shell script.
--
Posted via a free Usenet account from http://www.teranews.com
.
- References:
- How to tell if my VB6 program is running under the debugger
- From: ImageAnalyst
- How to tell if my VB6 program is running under the debugger
- Prev by Date: How to tell if my VB6 program is running under the debugger
- Next by Date: Re: VB6 and access 2000. query works in access but gets error in VB
- Previous by thread: How to tell if my VB6 program is running under the debugger
- Next by thread: Re: How to tell if my VB6 program is running under the debugger
- Index(es):
Relevant Pages
|