My Unity UWP app running on hololens is calling c++ functions imported from dll file. Said library prints a lot of useful debug information to standard output and I need to access them.
Asked
Active
Viewed 932 times
1 Answers
1
Do you mean to print debug log in the console from CPP DLL?
You can write a callback function in C# that takes a string as it's argument and print it into the Unity's console window, and then pass a pointer of this function to C++ dll, so you can call the function from C++ by it's pointer, this will redirect your strings from C++ to log window. For a more detailed solution, please see here: Use Debug.Log from C++

Hernando - MSFT
- 2,895
- 1
- 5
- 11
-
You might also be able to redirect standard output to your own function based on suggestions [here](https://stackoverflow.com/questions/4810516/c-redirecting-stdout). – chrisfromwork Sep 30 '19 at 17:03