gpt4 book ai didi

debugging - 检测VB6中是否附加调试器

转载 作者:行者123 更新时间:2023-12-04 13:08:45 24 4
gpt4 key购买 nike

我正在对我们用 Visual Basic 6 编写的一个旧应用程序进行一些维护工作,由于各种原因,我们有一部分代码只有在我们通过 VB6 IDE 运行程序时才需要运行(即,调试器已附加)。

在 VB.NET 中,您可以使用 System.Diagnostics.Debugger.IsAttached() 来做到这一点。属性,但我在谷歌上的 VB6 中找不到任何类似的东西。

是否有一些简单的方法可以找出这些信息?

最佳答案

这是我们正在使用的没有任何副作用的

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

关于debugging - 检测VB6中是否附加调试器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9505750/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com