I am currently calling a DLL from labview, but I need to be able to debug it realtime (because of it's accessing time sensitive hardware). I would like to just printf() my error assert messages but I am unsure about how to open a DOS window from within the DLL to dump error information to. Has anyone done this before? I know I could do this with a file, and I may have to. printf is just such a handy quick and dirty way to do this though :) .
相关问题
- Multiple sockets for clients to connect to
- How to know full paths to DLL's from .csproj f
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
Instead of using printf() you can use Windows's OutputDebugString() function, and check the debug output in DebugView.
1) Make a call to the windows api AllocConsole.
2) You will probably need to call GetStdHandle to get stdout/stderr.
3) Printf to your hearts content!