Click to See Complete Forum and Search --> : multithreading locks my form


rantech
September 6th, 2005, 09:36 AM
i have a multithreaded app(dialog based) . when the threads are running the main form isn't responding .
i tried with DoEvents() to dispatch the messages but i don't really like the results . so i understand that the solution would be a gui thread ? or what ?
there's anybody here that could tell me exactly how to do it ? (on the dialog class generated by mfc )

MrViggy
September 6th, 2005, 11:39 AM
What thread is the main form running in? I usually leave all my GUI elements in the main application thread, and kick off worker threads to do the work. That way I don't need to be concerned with creating GUI type threads...

Viggy

rantech
September 6th, 2005, 12:36 PM
this would be the same for me. the main app gui..i'll have the UI elements...and some threads that are downloading some files from the internet . but when i start this threads.. i can't interact with the interface(although i see it). So, do i create another thread for the main app ?

kirants
September 6th, 2005, 08:50 PM
Your main app is already running in the process' main thread.

Please post the code of how you create those worker threads.

rantech
September 7th, 2005, 04:46 AM
[problem solved] the threads were going out of scope and close themselves !