Re: Message between threads



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



.



Relevant Pages

  • Re: Help Regarding GUI
    ... tk.i want to design a gui with a List of 5 fields and display it with ... and when running the script the gui is ... pack $f.label -side left ...
    (comp.lang.tcl)
  • Re: To change Background in MATLAB GUI
    ... screensize = get; ... that but then how do you place all the various other controls that you ... I tried making such a GUI with GUIDE and ... % Load in a background image and display it using the correct ...
    (comp.soft-sys.matlab)
  • GUI Help For Showing Data and Pictures
    ... The serial and webcam part work great. ... But now I want to make a GUI that does the following: ... The users information will be stored ... and the computer knows what data to display ...
    (comp.soft-sys.matlab)
  • Re: Displaying results in GUI
    ... At some point you need to signal to your gui to do the ... computation and display the result. ... eventdata, handles, varargin)). ... set(handles.textbox, 'String', result); ...
    (comp.soft-sys.matlab)
  • Re: Best book for creating GUI using Visual C++ (VS 2003)
    ... Microsoft does not seem to have anyone establishing GUI design ... Rarely do I need to see two windows at once. ... display, and do my editing full-screen in the left-hand display. ...
    (microsoft.public.vc.mfc)