Re: SOLVED Dialog : How to update an Edit Box?
Quote:
Originally Posted by
GCDEF
I still prefer message pumps. Easier to set up and less to coordinate.
Some feel that way. My experience is this is true for only very simple scenarios. For more complex scenarios (where you would like to control the operation), a proper threaded solution is usually easier to implement and maintain.
In my opinion, if you are trying to retrieve data from some external source (like a device, serial port, or network), you should never put this work inside the main UI thread. The reason being is that the user can interrupt the operation and cause data loss by simply moving the window or the mouse.
Let's have a little fun. Code up a simple app that performs some external data operation that needs to be started, stopped, paused, and restarted. Do it all in the main UI thread and then I'll do it using a secondary thread and we'll compare the two approaches.
Re: SOLVED Dialog : How to update an Edit Box?
Quote:
Originally Posted by
GCDEF
I still prefer message pumps. Easier to set up and less to coordinate.
I think that the message pump is easier only for trivial cases. Otherwise there could be a LOT of things to consider:
- can you interrupt your process often enough to pump messages?
- is a start of modal dialog going to affect your pump?
- do you need to translate accelerators, and are there more than one table?
I could through more things in this mix, but I am sure – you can too.