绕过 Delphi 7 中的 OutputDebugString?
我想知道是否可以绕过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
那是不可能的。
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.
我认为这是没有办法解决的。 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?
您可以尝试使用 进程监视器 及其新的“而不是 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.
在事件日志属性中禁用“输出消息”不起作用?
Disabling "output messages" in the Event Log properties does not work?
我意识到,这不是最初的问题,但值得一看 CodeSite 来自Raize Software。它将 OutputDebugString 提升到了一个全新的水平。消息(可以)定向到 CodeSite 查看器,该查看器大致相当于高度增强的 DebugView。恕我直言,每一分钱都值得。
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.