0

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?

Without Me It Just Aweso
  • 4,593
  • 10
  • 35
  • 53

2 Answers2

1

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.

Mike Cheel
  • 12,626
  • 10
  • 72
  • 101
  • Under Windows 2000, XP, Server 2003 and Vista DebugView will capture: Win32 OutputDebugString Kernel-mode DbgPrint All kernel-mode variants of DbgPrint implemented in Windows XP and Server 2003 DebugView also extracts kernel-mode debug output generated before a crash from Window's 2000/XP crash dump files if DebugView was capturing at the time of the crash. – Mike Cheel Nov 15 '10 at 19:56
1

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.

Community
  • 1
  • 1
wageoghe
  • 27,390
  • 13
  • 88
  • 116