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
  • 10,234
  • 7
  • 48
  • 75

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
  • 132,049
  • 21
  • 248
  • 298