I'm trying to use printf with a cvi project in Visual Studio. I get the stdio window but my printf & gets statements seem to be ignored. I enclosed the code between 2 popups. The 2 popups are displayed, the code in between is being ignored. Anyone know : What am I missing ? here's the code :
#include <cvirte.h>
#include <ansi_c.h>
#include <userint.h>
#include <utility.h>
#include <gpib.h>
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
char instr[20];
// Initialize the CVI Run-time Engine
if (InitCVIRTE(hInstance, 0, 0) == 0) return -1;
MessagePopup("", "Start");
SetStdioPort(HOST_SYSTEM_STDIO);
SetStdioWindowVisibility(1);
printf("Enter Command\n");
gets(instr);
MessagePopup("","Done");
}