Data seem stucking when deburging with Serial Port
I am making a MFC application with VC++2012 with receiving data from Serial Port and the data is stored in a Listbox, then after processing (convert into numbers) and get these data to draw a sine wave on the chart. (I intend to make a virtual oscilloscope).
Everything works ok at the beginning, but after receiving about 300 items or above (in the Listbox) the value seem stucking (or lagging) and work very slowly.
I receive data by the SerialPort_DataReceived() method, and process of converting and drawing chart also in this method, I think this makes the system overload!!!!
Does anyone has the problem like me???And have any better idea for my solution!!!
Re: Data seem stucking when deburging with Serial Port
The usual design of such type of application is:
a main GUI thread where you display data
a worker thread that receives data from serial port and post it to the main thread.
See Serial Port I/O, Using Worker Threads