Click here to Skip to main content
15,884,388 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: help c++ Pin
BadKarma23-Feb-06 20:36
BadKarma23-Feb-06 20:36 
AnswerRe: help c++ Pin
ThatsAlok23-Feb-06 21:42
ThatsAlok23-Feb-06 21:42 
QuestionRe: help c++ Pin
David Crow24-Feb-06 3:14
David Crow24-Feb-06 3:14 
QuestionEnding Thread Problems Pin
tbrake23-Feb-06 14:03
tbrake23-Feb-06 14:03 
AnswerRe: Ending Thread Problems Pin
Ryan Binns23-Feb-06 14:10
Ryan Binns23-Feb-06 14:10 
GeneralRe: Ending Thread Problems Pin
tbrake23-Feb-06 14:17
tbrake23-Feb-06 14:17 
GeneralRe: Ending Thread Problems Pin
Ryan Binns23-Feb-06 14:50
Ryan Binns23-Feb-06 14:50 
GeneralRe: Ending Thread Problems Pin
Blake Miller24-Feb-06 5:26
Blake Miller24-Feb-06 5:26 
Exactly. If the thread does not end 'quickly' while doing its own work, then it is obviously making alot of synchronous calls, so then you need a redesign anyway, otherwise, it is just safest to wait.
In between making calls to do wok, the thread should check an 'exit' flag - a variable set to tru or soemthing. While 'waiting' for something to finish, it should use synchronization functions. You might have to use overlapped IO or look for asynchronous methods and API for things yo are doing synchronously. Also, try adjusting timeouts on operations.
If you know you are waiting, you can always tell user 'waiting for XXX to finish before shutting down' or some such message. In the case of Windows shutting down, well perhaps whatever you are waiting for will terminate, so your thread can finish up nicely anyway.


People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
QuestionHow to display the value of a variable in a MessageBox? Pin
vinceher23-Feb-06 10:18
vinceher23-Feb-06 10:18 
AnswerRe: How to display the value of a variable in a MessageBox? Pin
David Crow23-Feb-06 10:31
David Crow23-Feb-06 10:31 
AnswerRe: How to display the value of a variable in a MessageBox? Pin
Stephen Hewitt23-Feb-06 10:45
Stephen Hewitt23-Feb-06 10:45 
GeneralRe: How to display the value of a variable in a MessageBox? Pin
vinceher23-Feb-06 13:27
vinceher23-Feb-06 13:27 
GeneralRe: How to display the value of a variable in a MessageBox? Pin
Stephen Hewitt23-Feb-06 13:34
Stephen Hewitt23-Feb-06 13:34 
GeneralRe: How to display the value of a variable in a MessageBox? Pin
Wim Engberts23-Feb-06 23:21
Wim Engberts23-Feb-06 23:21 
QuestionInfo about Digital image watermarking in the Wavelet transform domain ? Pin
Loay Al Lusi23-Feb-06 9:36
Loay Al Lusi23-Feb-06 9:36 
AnswerRe: Info about Digital image watermarking in the Wavelet transform domain ? Pin
Stephen Hewitt23-Feb-06 19:16
Stephen Hewitt23-Feb-06 19:16 
AnswerRe: Info about Digital image watermarking in the Wavelet transform domain ? Pin
Cool Ju23-Feb-06 20:01
Cool Ju23-Feb-06 20:01 
QuestionSorting items, specifying multiple parameters Pin
Gunn31723-Feb-06 9:25
Gunn31723-Feb-06 9:25 
AnswerRe: Sorting items, specifying multiple parameters Pin
David Crow23-Feb-06 9:35
David Crow23-Feb-06 9:35 
GeneralRe: Sorting items, specifying multiple parameters Pin
Gunn31723-Feb-06 10:15
Gunn31723-Feb-06 10:15 
GeneralRe: Sorting items, specifying multiple parameters Pin
David Crow23-Feb-06 10:30
David Crow23-Feb-06 10:30 
AnswerRe: Sorting items, specifying multiple parameters Pin
Chris Losinger23-Feb-06 9:38
professionalChris Losinger23-Feb-06 9:38 
GeneralRe: Sorting items, specifying multiple parameters Pin
Gunn31723-Feb-06 10:11
Gunn31723-Feb-06 10:11 
GeneralRe: Sorting items, specifying multiple parameters Pin
Chris Losinger23-Feb-06 10:28
professionalChris Losinger23-Feb-06 10:28 
GeneralRe: Sorting items, specifying multiple parameters Pin
Gunn31723-Feb-06 11:08
Gunn31723-Feb-06 11:08 

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.