LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Viewing printf() stdio output from a Microsoft C++ Express .dll in LabWindows

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?

0 Kudos
Message 1 of 2
(3,943 Views)

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.

National Instruments
0 Kudos
Message 2 of 2
(3,918 Views)