Click here to Skip to main content
15,886,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: visual studio 2008 QT project with c++ Pin
Mkhitar Sargsyan14-Oct-13 0:42
Mkhitar Sargsyan14-Oct-13 0:42 
GeneralRe: visual studio 2008 QT project with c++ Pin
Richard MacCutchan14-Oct-13 1:04
mveRichard MacCutchan14-Oct-13 1:04 
GeneralRe: visual studio 2008 QT project with c++ Pin
Mkhitar Sargsyan14-Oct-13 1:20
Mkhitar Sargsyan14-Oct-13 1:20 
GeneralRe: visual studio 2008 QT project with c++ Pin
Richard MacCutchan14-Oct-13 1:51
mveRichard MacCutchan14-Oct-13 1:51 
Questionbcmenu.cpp for XP and 7/8 Pin
DanYELL11-Oct-13 18:39
DanYELL11-Oct-13 18:39 
AnswerRe: bcmenu.cpp for XP and 7/8 Pin
Richard MacCutchan11-Oct-13 22:24
mveRichard MacCutchan11-Oct-13 22:24 
Questionwhat if thread terminated after the thread::joinable() test Pin
Wang Xin USTC11-Oct-13 3:01
Wang Xin USTC11-Oct-13 3:01 
AnswerRe: what if thread terminated after the thread::joinable() test Pin
pasztorpisti11-Oct-13 3:44
pasztorpisti11-Oct-13 3:44 
It is possible that the thread actually finishes/terminates between the if and the join but it won't cause an error. Even if the thread terminates the kernel maintains the thread handle and/or a result object (with the thread exit code) that can be waited (and queried for the exit code). If the thread has already terminated when you call join then join returns immediately without problems.

EDIT: some additional qotes from http://en.cppreference.com/w/cpp/thread/thread/joinable[^]
"A thread that has finished executing code, but has not yet been joined is still considered an active thread of execution and is therefore joinable."

On windows (Winapi thread functions) you can have multiple handles to the same thread and when the thread terminates all handles become signaled and you can wait any of the handles any number of times until closing the handles. On unix like systems the pthread api is more restrictive: you get a thread handle when you create a (non-detached) thread and you have to wait exactly once and only once for the thread handle. If you don't wait for the thread handle then it causes a leak, if you wait for it multiple times then its an error. Waiting for it once gets the exitcode from the temp object (associated with the thread handle) and also frees this temp object.

Both behaviors can be simulated by a framework but C++11 chose something that is near to the unix philosophy (as implementing that on all platforms is simpler and more performant and usually enough).
QuestionBEGIN_MESSAGE_MAP never called? Pin
bosfan11-Oct-13 0:29
bosfan11-Oct-13 0:29 
QuestionRe: BEGIN_MESSAGE_MAP never called? Pin
Richard MacCutchan11-Oct-13 1:27
mveRichard MacCutchan11-Oct-13 1:27 
AnswerRe: BEGIN_MESSAGE_MAP never called? Pin
bosfan11-Oct-13 2:20
bosfan11-Oct-13 2:20 
GeneralRe: BEGIN_MESSAGE_MAP never called? Pin
Richard MacCutchan11-Oct-13 3:14
mveRichard MacCutchan11-Oct-13 3:14 
AnswerRe: BEGIN_MESSAGE_MAP never called? Pin
bosfan11-Oct-13 3:16
bosfan11-Oct-13 3:16 
Questionsave Bmp image in sql server in vc++ Pin
chetan78610-Oct-13 22:30
chetan78610-Oct-13 22:30 
AnswerRe: save Bmp image in sql server in vc++ Pin
Richard MacCutchan10-Oct-13 23:42
mveRichard MacCutchan10-Oct-13 23:42 
GeneralRe: save Bmp image in sql server in vc++ Pin
chetan78610-Oct-13 23:57
chetan78610-Oct-13 23:57 
GeneralRe: save Bmp image in sql server in vc++ Pin
chetan78610-Oct-13 23:59
chetan78610-Oct-13 23:59 
QuestionGetting Error Code "1407" in CreateDialogIndirect Pin
sukhas1910-Oct-13 1:19
sukhas1910-Oct-13 1:19 
AnswerRe: Getting Error Code "1407" in CreateDialogIndirect Pin
Richard MacCutchan10-Oct-13 3:31
mveRichard MacCutchan10-Oct-13 3:31 
GeneralRe: Getting Error Code "1407" in CreateDialogIndirect Pin
sukhas1910-Oct-13 5:36
sukhas1910-Oct-13 5:36 
GeneralRe: Getting Error Code "1407" in CreateDialogIndirect Pin
Richard MacCutchan10-Oct-13 6:11
mveRichard MacCutchan10-Oct-13 6:11 
QuestionHello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 19:24
professionalMember 103268989-Oct-13 19:24 
SuggestionRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 21:06
mveRichard MacCutchan9-Oct-13 21:06 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 21:41
professionalMember 103268989-Oct-13 21:41 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 22:46
mveRichard MacCutchan9-Oct-13 22:46 

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.