简体   繁体   English

如何在 Unity UWP 应用程序中捕获 dll 的标准 output?

[英]How to capture std output of dll in Unity UWP app?

My Unity UWP app running on hololens is calling c++ functions imported from dll file.我在 hololens 上运行的 Unity UWP 应用程序正在调用从 dll 文件导入的 c++ 函数。 Said library prints a lot of useful debug information to standard output and I need to access them.所述库向标准 output 打印许多有用的调试信息,我需要访问它们。

Do you mean to print debug log in the console from CPP DLL?您的意思是从 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. 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将您的字符串从 C++ 重定向到日志 window。 For a more detailed solution, please see here: Use Debug.Log from C++有关更详细的解决方案,请参阅此处:使用 C++ 中的 Debug.Log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM