Re: How to tell if my VB6 program is running under the debugger



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

.



Relevant Pages

  • How to tell if my VB6 program is running under the debugger
    ... How can I tell if my program is running under the VB6 IDE? ... equipment but my deployed systems do. ... despite failing calibration but only if I know it's me ... ' We're running in VS2005 debugging environment. ...
    (comp.lang.basic.visual.misc)
  • Re: Calibration equipment design
    ... I guess the equipment manufacturers did the same a long time ago to have ... secondary standards are pricey, ... An above standard precision is ok. ... Making electronic equipment or calibration standards do not differ much, ...
    (sci.electronics.equipment)
  • Re: Attn: Fish Punsters
    ... Yes, I have a PAT box, but I can't use it in anger as it's a non-legit ... Cost of calibration is enough to make it not worth ones while unless ... I used to use the Clare tester; ... equipment that I used to check was tested on a three yearly basis, ...
    (uk.media.radio.archers)
  • Re: New portable DVD player....
    ... > Electronic calibration in the panic before an inspection is gonna cost ... > I remember one time the Canopus cal lab got overloaded and there was ... > and my shop filled up with some sub's equipment within an hour! ...
    (rec.boats.cruising)
  • Re: New portable DVD player....
    ... Electronic calibration in the panic before an inspection is gonna cost ... I remember one time the Canopus cal lab got overloaded and there was ... and my shop filled up with some sub's equipment within an hour! ...
    (rec.boats.cruising)