s***@mvps.org
2012-03-30 01:46:31 UTC
In your original post you said you wanted to compute something in the thread 40 times and display the result in the GUI. So after the thread computes it should post the result in the wParam.
In your most recent post you now have the result (newvalue) shown as a parameter, but you still don't use it! Instead, you are setting newvalue to something else, then displaying the something else. The task of the OnSendCalculatedValue function should be to display the newvalue that it receives from the thread.
In your most recent post you now have the result (newvalue) shown as a parameter, but you still don't use it! Instead, you are setting newvalue to something else, then displaying the something else. The task of the OnSendCalculatedValue function should be to display the newvalue that it receives from the thread.
Is there a possibility to calculate in the Thread procedure the
operation rand()*m_Slider.GetPos()
Yes. Whenever the slider changes you get OnHScroll. Have the main thread OnHScroll store the GetPos() in an int variable. The thread can read the int value without synchronization.operation rand()*m_Slider.GetPos()