Re: Message between threads
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Thu, 25 May 2006 14:52:43 -0700
Well, you certainly don't want to do anything modal in WM_PAINT! If you
just want to be sure you see each state, put a Sleep( 2000 ) in each non-GUI
thread or something (send debug messages using DEBUGMSG or OutputDebugString
when you enter each state). Debugging threaded applications is a challenge.
Paul T.
"wceess" <wceess@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:68F76BF7-8622-4B48-96F5-8DECD9554E9C@xxxxxxxxxxxxxxxx
Hi paul,
Thanks for ur reply. No i do have GUI in my application. That was just a
test code that i developed to test communication between threads. Now as u
said i kept my GUI as main thread and created other two threads when i am
in
WM_CREATE. I am passing global variables between threads but using
critical
section for security purpose. I got my GUI up and running. I just have a
timing issue now. When i step through the code with breakpoints i get all
the
states of my application in GUI. But if i make the system to run without
breakpoints the system hangs.
I have 4 states in my application and i am trying to display those four
states in GUI (each state should stay in display for atleast 2 sec) just
to
make sure my message passing between threads are working. These states
depends on the global variable i set on the comm and alg thread and based
on
this i change the *.bmp in my GUI. Right now the way i am doing this is, i
wrote a function set_system_state where i acesses the global variables
from
other threads using mutex and on waitingon an event that is set after the
other two threads run..then i poll this in WM_PAINT . If i step through
each
*.bmp pops up in my display but not in free run. I am wondering that is
because of WM_PAINT. Need your advice.
thanks
.
- References:
- Re: Message between threads
- From: Paul G. Tobey [eMVP]
- Re: Message between threads
- From: Steve Maillet \(eMVP\)
- Re: Message between threads
- From: Paul G. Tobey [eMVP]
- Re: Message between threads
- From: wceess
- Re: Message between threads
- From: wceess
- Re: Message between threads
- From: Paul G. Tobey [eMVP]
- Re: Message between threads
- Prev by Date: Possible to pass strings back to ASP from ActriveX?
- Next by Date: Re: Message between threads
- Previous by thread: Re: Message between threads
- Next by thread: Re: Message between threads
- Index(es):
Relevant Pages
|