|
-
April 2nd, 2012, 01:18 AM
#3
Re: MFC help for building GUI in microsoft visual studio 2008
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
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|