You should create a worker thread and move your code to communicate with the serial port (GPS) to this thread. Note: only code tocommunicate with the serial port, not the statements to update GUI!

Then your worker thread has to periodically notify the main GUI thread about new received data (the easiest way to notify is to PostMessage some user defined message(s); then the main thread will update its GUI from the message handler(s) ofthis (these) user defined message(s)).

See Joe Newcomer's essay Using Worker Threads