Problem with multithreaded application (Cont.)

G

Guest

Let me be more explicit on the problem: i've been making some testings on my
application and i realized that the application hangs in this situation:
I have a main window created in the thread which called Application.Run so
it has the message loop right? Well, then i have another thread wich
represents an entity which has to do its own operations (worker thread
created with the thread object) .Then i ask my thread object to show a
monitor where it has to write its progress in the operation, this monitor is
a non-modal dialog. The worker thread calls a method to obtain the form
which represents that monitor: this method will do a call of the Invoke
method in the form object which represents the main form of the application
and which was created in the thread which called the Application.Run
method,follow me? : ) .this invoking is to ask the UI thread to create a
monitor form object (i have to create the monitor object in the UI Thread as
it will be a non modal dialog which i will show using its Show method so it
won't have a message queue by itself ,this is the opposite to what happens if
i want it to be a modal dialog:then i call the showdialog method and it will
have its own messagequeue and it is not necessary for it to be created in the
UI Thread)
well thn the worker thread gets its monitor form object and do an Invoke to
call its Show method to display it.
Periodically the worker thread will do an Invoking to call a methos wich
updates the fields of the monitor object.
Well everything goes fine but when the monitor is running and i start moving
the main form from one side to other of the screen then the hang of the
application comes up. I think that it could be because i created the monitor
object in such a way that it share the messagequeu of the main form of the
application(creating this object in the UI Thread).
The problem is that i havent found the way to give a non modal dialog its
own message queue independent of the message queu of teh main form.
anybodu thinks that this could be the problem???? THANKS
 
M

MuZZy

Can you try to reproduce the bug on a smaller/simpler version of your
app which you could email me? I could take a look then.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top