Click here to Skip to main content
16,005,048 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: thread communications Pin
alberthyc10-Aug-07 10:32
alberthyc10-Aug-07 10:32 
GeneralRe: thread communications Pin
Mark Salsbery10-Aug-07 10:42
Mark Salsbery10-Aug-07 10:42 
GeneralRe: thread communications [modified] Pin
alberthyc10-Aug-07 10:55
alberthyc10-Aug-07 10:55 
GeneralRe: thread communications Pin
Mark Salsbery10-Aug-07 11:06
Mark Salsbery10-Aug-07 11:06 
GeneralRe: thread communications Pin
alberthyc10-Aug-07 11:17
alberthyc10-Aug-07 11:17 
GeneralRe: thread communications Pin
Mark Salsbery10-Aug-07 11:55
Mark Salsbery10-Aug-07 11:55 
GeneralRe: thread communications Pin
alberthyc10-Aug-07 16:04
alberthyc10-Aug-07 16:04 
GeneralRe: thread communications Pin
T-Mac-Oz10-Aug-07 16:44
T-Mac-Oz10-Aug-07 16:44 
I agree with Mark, event driven is definitely the way to go.

Option 1:
declare pbyData[] as an array of volatile values
use OnHScroll & OnVScroll to update the pbyData[] values when slider positions change
Add a pointer value (assigned to pbyData) as one of the members of THREADPARMS
Then you only have to check for the kill event in your worker thread.
Only one event to monitor which is only ever set from the main thread, no deadlocks.
NOTE: Without a SwitchToThread() call in the worker thread loop, this approach will kill your interface responsiveness (& your O/S responsiveness without a multicore CPU!). If you're thinking of a Sleep(...) call, you might as well use a timer...

Option 2:
use OnHScroll & OnVScroll to update the pbyData[] values when slider positions change
Set a timer (delay value depending on exactly what you mean by "continuously output")
Call SpcGetParam() in OnTimer()
No threads, no deadlocks.

T-Mac-Oz

GeneralRe: thread communications Pin
alberthyc11-Aug-07 8:01
alberthyc11-Aug-07 8:01 
AnswerRe: thread communications Pin
T-Mac-Oz11-Aug-07 19:37
T-Mac-Oz11-Aug-07 19:37 
AnswerRe: thread communications Pin
David Crow10-Aug-07 10:50
David Crow10-Aug-07 10:50 
QuestionDisplaying an Image(JPG,GIF) etc Pin
simon alec smith10-Aug-07 9:30
simon alec smith10-Aug-07 9:30 
AnswerRe: Displaying an Image(JPG,GIF) etc Pin
Mark Salsbery10-Aug-07 9:41
Mark Salsbery10-Aug-07 9:41 
GeneralRe: Displaying an Image(JPG,GIF) etc Pin
simon alec smith10-Aug-07 10:02
simon alec smith10-Aug-07 10:02 
QuestionRe: Displaying an Image(JPG,GIF) etc Pin
Mark Salsbery10-Aug-07 10:18
Mark Salsbery10-Aug-07 10:18 
AnswerRe: Displaying an Image(JPG,GIF) etc Pin
simon alec smith11-Aug-07 2:53
simon alec smith11-Aug-07 2:53 
GeneralRe: Displaying an Image(JPG,GIF) etc Pin
Mark Salsbery11-Aug-07 8:59
Mark Salsbery11-Aug-07 8:59 
AnswerRe: Displaying an Image(JPG,GIF) etc Pin
Hamid_RT10-Aug-07 19:00
Hamid_RT10-Aug-07 19:00 
GeneralRe: Displaying an Image(JPG,GIF) etc Pin
simon alec smith11-Aug-07 3:38
simon alec smith11-Aug-07 3:38 
QuestionHow to print from .bmp file image in memory Pin
bions10-Aug-07 9:03
bions10-Aug-07 9:03 
AnswerRe: How to print from .bmp file image in memory Pin
Mark Salsbery10-Aug-07 9:37
Mark Salsbery10-Aug-07 9:37 
AnswerRe: How to print from .bmp file image in memory Pin
bions13-Aug-07 7:58
bions13-Aug-07 7:58 
GeneralRe: How to print from .bmp file image in memory Pin
Mark Salsbery13-Aug-07 10:02
Mark Salsbery13-Aug-07 10:02 
Questionneed quick help Pin
klutez12310-Aug-07 8:15
klutez12310-Aug-07 8:15 
AnswerRe: need quick help Pin
Mark Salsbery10-Aug-07 8:18
Mark Salsbery10-Aug-07 8:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.