绕过 Delphi 7 中的 OutputDebugString?

发布于 2024-09-07 08:19:25 字数 162 浏览 4 评论 0原文

我想知道是否可以绕过 OutputDebugString?我希望 OutputDebugString 输出显示在 DebugView 中,而不是显示在内部 Delphi 事件查看器窗口中。但我找不到一种方法来告诉 Delphi 不要吞下 OutputDebugString。有什么想法吗?

问候

I'm wondering if it's possible to bypass the OutputDebugString? I'd like the OutputDebugString output showing up in DebugView and not in the internal Delphi Event Viewer window. But i can't find a way to tell Delphi not to swallow the OutputDebugString. Any ideas?

regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

兔姬 2024-09-14 08:19:25

那是不可能的。

OutputDebugString 将字符串发送到调试器(顾名思义)。每个进程只能有 1 个活动调试器。您在 Delphi 下运行您的应用程序 - Delphi 收到了消息,因为它是一个调试器。您在 Delphi 之外运行应用程序 - DebugView 可以访问它们,因为没有调试器声明它。

但是:为什么你需要这个?只需禁用 Delphi 事件日志中的其他类型的事件 - 您将获得与 DebugView 相同的功能。

That is not possible.

OutputDebugString sends string to debugger (as its name suggests). There can be only 1 active debugger per process. You run your application under Delphi - Delphi got the messages, since its a debugger. You run your application outside Delphi - DebugView can access them, since no debugger claimed it.

However: WHY do you need this? Just disable other types of events in Delphi event log - and you'll get the same functionality as DebugView has.

梅窗月明清似水 2024-09-14 08:19:25

我认为这是没有办法解决的。 Delphi 2009 中情况仍然相同。您应该提交功能请求:http://qc.embarcadero.com

我想知道这样做有什么好处Delphi的内部事件日志窗口应该是什么?

I think there is no way around this. The situation is still the same in Delphi 2009. You should submit a feature request: http://qc.embarcadero.com

I'm wondering what the advantage instead of Delphi's internal event log window should be?

乙白 2024-09-14 08:19:25

您可以尝试使用 进程监视器 及其新的“而不是 DebugView”调试输出”功能。它不使用 OutputDebugString,它使用自己的 API,还有一个 Delphi 包装器 此处。您可以使用 Process Monitor 过滤功能,Delphi 不会捕获该消息 - 但它不是像 OutputDebugString 那样的通用功能。

Instead of DebugView you can try to use Process Monitor and its new "debug output" capability. It does not use OutputDebugString, it uses its own API, and there's also a Delphi wrapper here. You can use Process Monitor filtering features and Delphi won't trap that messages - but it's not a generic features as those of OutputDebugString.

三生殊途 2024-09-14 08:19:25

在事件日志属性中禁用“输出消息”不起作用?

Disabling "output messages" in the Event Log properties does not work?

一向肩并 2024-09-14 08:19:25

Not what the original question asked, I realise, but it's worth taking a look at CodeSite from Raize Software. It takes OutputDebugString to a whole new level. Messages (can) get directed to a CodeSite viewer which is roughly equivalent to a highly souped up DebugView. Well worth every penny IMHO.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文