Another thing you can try is, to install a Callback with the function InstallComCallback. Everytime a user defined number of characters, or a user defined specific character is received on the serial port, an event is added to the Event queue, and the callback function is executed. So you do not have to poll the COM-Port, and the USer Interface Events can be handeled properly.
Best Regards,
André