Hi Experts -
Easy question (hopefully) - developing a serial data monotoring utility. Every time I get new data on the bus I want to display it in the main window. The set-up I have now is - the user hits a run button which calls onRun() from myDoc class - it opens up the serial port and it goes into an infinite while loop that polls the bus. If there is data on the bus - then it reads it and it calls UpdateAllViews(NULL) to make a call to pDC->TextOut(). This is crashing my application - any ideas?
Also - is it possible to put a flag on that infinite loop that'll get reset by another button (call it Stop)? So for example...
stop_recv_flag = 1;
status = read_bus (data);
if (status == ARS_GOTDATA)
stop_recv_flag = 0;
So if I hit the stop button to call OnStop will it break the while loop if stop_recv_flag is a global variable?