Visual Studio 查看 DLL 中的 StandardOuptut 流
我有一个使用自定义 DLL 的 ac# 应用程序(用 C 编写,用 CL 构建)。
该 DLL 有许多 printf,我希望能够在运行我的 C# 应用程序时查看它们。到目前为止,我还没有弄清楚如何在 Visual Studio(2010 或 2005)中查看 DLL 的输出。
我有一个 C 语言的测试应用程序,它从命令行运行 dll,我可以在那里看到输出。
是否可以在 Visual Studio 中看到该输出?我是否需要以不同的方式构建 DLL 才能以某种方式启用它?
I have a c# application that is using a custom DLL (written in C, built with CL).
the DLL has many printf's that I'd like to be able to view while running my c# app. So far I havnt been able to figure out how to view the output from the DLL in visual studio (2010 or 2005).
I have a test app in C that runs the dll from command line and I can see the output fine there.
Is it possible to see that output in Visual Studio? Do I need to build the DLL differently to enable it somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以考虑 Sysinternals 提供的名为 DebugView 的免费实用程序:
http://technet.microsoft。 com/en-us/sysinternals/bb896647.aspx
我不确定这是否能完全解决您的问题,但如果呼叫通过正确的位置,您也许可以接听它们。尝试一下也没什么坏处。
You might consider the free utility from Sysinternals called DebugView:
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
I'm not sure if this will exactly solve your problem but if the calls are going through the right place you might be able to pick them up. It can't hurt to try.
您没有问这个问题,但我将在此处添加一条有关在调试托管代码(在我的例子中为 C#)时在调试器中查看 OutputDebugString 输出的注释。我必须在“项目”->“属性”->“调试”选项卡上设置“启用非托管代码调试”选项,才能查看 OutputDebugString 的输出。请注意,这可能与 printf 无关,但如果您的 C dll 使用 OutputDebugString,它可能会很有用。
因此,如果您使用 OutputDebugString,请注意这一点。
这是指向我原始问题的链接我在其中询问了 OutputDebugString 和 VS 输出窗口。
You didn't ask this, but I will add a note here about viewing OutputDebugString output in the debugger when debugging managed code (C# in my case). I had to set the "Enable unmanaged code debugging" option on the Project->Properties->Debug tab in order to see the output from OutputDebugString. Note that this probably has nothing to do with printf, but it might be useful if your C dll is using OutputDebugString.
So, beware of that if you are using OutputDebugString.
Here is a link to my original question where I asked out OutputDebugString and the VS output window.