I'm doing some maintenance work on one of our old applications that is written in Visual Basic 6, and for various reasons, we have a part of the code that only needs to be run if we are running the program through the VB6 IDE (i.e., the debugger is attached).
In VB.NET, you can do this by using the System.Diagnostics.Debugger.IsAttached()
property, but I can't find anything similar in VB6 on Google.
Is there some easy way to figure this information out?
Here is what we are using that does not have any side effects
Public Property Get InIde() As Boolean
Debug.Assert pvSetTrue(InIde)
End Property
Private Function pvSetTrue(bValue As Boolean) As Boolean
bValue = True
pvSetTrue = True
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With