Re: UI Thread : Where's the processing?
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Tue, 24 Jan 2006 20:03:14 -0500
Roger Garrett wrote:
Igor,
I guess you're right. My reading of the documentation on worker and UI threads left me a bit confused. It appeared to me that what it was saying was that, if you want your main application window to continue to receive UI messages you had to use UI threads for any of your threading needs. And then I found some examples on the Internet they seemd to support my mistaken understanding. [In addition, those examples all did their main processing for the thread within the InitInstance method and then returned FALSE from InitInstance to effectively shut the thread down. So I guess I was led astray, even farther from my initial confusion].
The so-called MFC UI thread is designed to be message driven, using its built in message pump. If you don't want or need a message driven thread then you can feel free to start a worker thread, which is simply a function. Such a worker thread function is probably what you are looking for as the place where a thread does its "main processing." MFC certainly does not require you to use UI threads - it provides two prototypes of AfxBeginThread - one for creating UI threads and one for creating worker threads.
-- Scott McPhillips [VC++ MVP]
.
- References:
- Re: UI Thread : Where's the processing?
- From: Igor Tandetnik
- Re: UI Thread : Where's the processing?
- Prev by Date: Re: UI Thread : Where's the processing?
- Next by Date: Re: XML Processing instruction for UTF-8
- Previous by thread: Re: UI Thread : Where's the processing?
- Next by thread: assisiative operators
- Index(es):