2

I have a solution that is mostly C#, but has also few C++ projects.
At some point I call a c++ dll from C# code.

Is there a way to write to visual studio output window from the c++ code (for debugging purposes)? I tried printf but it did not seem to have any effect...

(I am using VS 2012, .Net 4.5)

Avi Turner
  • 9,682
  • 7
  • 47
  • 70

1 Answers1

1

You can use the OutputDebugString function.

If you want to support variable arguments (like printf), you need to add a bit more code as in this answer: How do you create a debug only function that takes a variable argument list? Like printf()

Community
  • 1
  • 1
Simon Mourier
  • 123,662
  • 18
  • 237
  • 283