LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

After converting a CVI/Labindows project to VisualC 6.0 no standard IO window appears

I have a CVI project in Measurement Studio 6.0 that I converted to a VisualC 6.0 workspace using the "NI Measurement Studio AppWizard" under create new project.
I have printf to standard output that pops up the standard IO window when compiled under CVI, but when I compile under VisualC no standard IO window appears. Can anyone provide an answer on how to get STDIO to work correctly?
0 Kudos
Message 1 of 4
(3,139 Views)
I would make sure that the preprocessor is defining _CONSOLE and not _WINDOWS.  Go to your project settings, and under the C/C++ tab (General category), look at your preprocessor definitions.  If you see _WINDOWS, replace it with _CONSOLE.  Hopefully that will solve your problem.

Mert A.
National Instruments
0 Kudos
Message 2 of 4
(3,127 Views)
That does not appear to make a difference to the funciton of printf. I have discovered that the CVI routine FmtOut works correctly so it appears that the handle to the console screen for printf is wrong. I notice that the compiler picks up the windows stdio.h not the CVI stdio.h - is it a library path problem do you think? How can I correct it?
0 Kudos
Message 3 of 4
(3,124 Views)
A CVI project compiled in VC will use the VC version of the ANSI standard I/O libraries, not the CVI ones. I don't think this can be changed. Therefore, if you use functions like printf() and scanf() that implicitly or explicitly use the 'stdin', 'stdout' or 'stderr' file handles, the VC project must be configured as a Win32 console application.


At the very least, you must make the preprocessor definition change that Mert A suggested, and you must add or modify the link /subsystem option to read /subsystem:console.


Martin.

--
Martin
Certified CVI Developer
0 Kudos
Message 4 of 4
(3,110 Views)