Click to See Complete Forum and Search --> : Multi-threading with dialog boxes??


IAstudent
March 29th, 2004, 04:38 AM
Hi,
Just need to verify something:

1) Is it possible to have a dialog box in the background carrying out certain tasks while another dialog box is displaying certain text out in the front?

2) How about other tasks e.g. computation of data, etc? Can they run in the background while a dialog box is in front, displaying text??

Thanks in advance!

Alin
March 29th, 2004, 05:00 AM
Originally posted by IAstudent
Hi,
Just need to verify something:

1) Is it possible to have a dialog box in the background carrying out certain tasks while another dialog box is displaying certain text out in the front?

2) How about other tasks e.g. computation of data, etc? Can they run in the background while a dialog box is in front, displaying text??

Thanks in advance!

you'll need a worker thread for your tasks.
check the FAQ. there are several articles showing you the way to get started.

Andreas Masur
March 29th, 2004, 06:03 AM
[Moved thread]

Andreas Masur
March 29th, 2004, 06:05 AM
Take a look at the following FAQs:

How to create a worker thread? (http://www.codeguru.com/forum/showthread.php?s=&threadid=231241)
How to end a thread? (http://www.codeguru.com/forum/showthread.php?s=&threadid=231242)
How to use member functions as thread functions? (http://www.codeguru.com/forum/showthread.php?s=&threadid=231246)
How to access UI elements from a thread in MFC? (http://www.codeguru.com/forum/showthread.php?s=&threadid=231250)

BKP
March 29th, 2004, 11:53 AM
You do not need to use multithreading techniques. You could use messaging between dialog to communicate between them. I think it's easier way than multithreading.

Sam Hobbs
March 29th, 2004, 05:26 PM
Yes, IAstudent, you might not need more than one thread, in which case this discussion thread should not have been moved to the multithreading forum.

A dialog box is not a thread. So if you are still not sure whether you need a thread, be more specific about why you think you might. The important thing is to describe what needs to be done without assuming you need to use a thread.