2

My log4net is logging to the visual studio output windows but what code can I use in the C++ win32 code to do the same as I need to debug the C++ and can't seem to step through it at all and logging would be useful in production as well anyways. I added

wprintf(L"Registering hook handler\n"); 

but that doesn't seem to work. It has been years since I have done C++ as well, let alone win32 C++.

Deanna
  • 23,876
  • 7
  • 71
  • 156
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212

1 Answers1

4

I think you're looking for OutputDebugString().

Deanna
  • 23,876
  • 7
  • 71
  • 156
David Norman
  • 19,396
  • 12
  • 64
  • 54
  • that doesn't seem to work for me for some reason :(. or maybe I don't know how to open the right output view. I only see an Immediate View tab and an Output tab and it doesn't go to either of those. – Dean Hiller Jun 20 '12 at 18:07
  • You need to be running with the debugger. If you do, it should show up in the Output window when Debug is selected in the pull down. – David Norman Jun 21 '12 at 00:13
  • I was running with the Debugger(the little Play icon with Debug in the pulldown). Does it matter that the my main project is C# and one of the other projects is C++? I thought it would be sucked in and the whole solution run in debug mode? Maybe I am missing something here. – Dean Hiller Jul 02 '12 at 18:40