02-07-2012 10:46 AM
I have a .dll + import library compiled in Microsoft Visual C++ 2008 Express. The .dll is multi-threaded. In a sub-thread of the .dll are some printf() statements. These are the printf()'s of interest.
I am using the .dll + import library in a LabWindows/CVI 2010 application. The .dll is working fine, except I don't know how to see the printf() outputs mentioned above.
I've tried a few combinations of SetStdioPort and SetStdioWindowVisibilty to no avail.
Anybody got any suggestions on how to see the printf() outputs, short of saving it to file?
02-08-2012 03:56 PM - edited 02-08-2012 03:58 PM
stdout and stdin are per process rather than per thread, so even if you have a multithreaded DLL, all of your printf statements should appear in the same location. That is unless the DLL changes the stdout stream around the printf statements.
With SetStdioPort are you setting the output to go to the CVI Stdio Window or the Host System's Stdio? Are you able to print to stdout in your main thread? What about in other applications? Is there a difference between release and debug? Can you see the output in Window >> Debug Output?
Addtionally, you must call SetStdioPort before any other console I/O functions. In other words, put it in main with your other initialization routines.