Hello,
I'm having trouble with ProcessSystemEvents and still can't get this to work.
I have a batch file which takes about one minute to run. I'd like to have an infinite loop (right now set up as a for loop) and run the batch files until a user presses the STOP button. So the process starts, the DOS window comes up and my batch file starts. I maddly try click on STOP, but cannot get out of the loop. I never get the stop button pushed.
stoptheloop is a global variable. The panel this is happening from is a popup type, if that matters.
Any help or suggestions would be appreciated.
int CVICALLBACK BEGINLOOP (int panel, int control, int event,
void *callbackData, int eventDa
ta1, int eventData2)
{
int i;
switch (event)
{
case EVENT_COMMIT:
stoptheloop = 0;
for (i=1; i < 10; i++)
{
system("extvsimtb_switch6port.bat");
ProcessSystemEvents();
if (stoptheloop == 1) break;
DebugPrintf("stoptheloop = %d\n",stoptheloop);
}
break;
}
return 0;
}
int CVICALLBACK STOPLOOP (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
stoptheloop = 1;
break;
}
return 0;
}