Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I don't know how to do!? Pin
Ron Beyer12-Oct-13 17:56
professionalRon Beyer12-Oct-13 17:56 
AnswerRe: I don't know how to do!? Pin
Captain Price14-Oct-13 1:40
professionalCaptain Price14-Oct-13 1:40 
Questionvisual studio 2008 QT project with c++ Pin
Mkhitar Sargsyan12-Oct-13 4:10
Mkhitar Sargsyan12-Oct-13 4:10 
AnswerRe: visual studio 2008 QT project with c++ Pin
Richard MacCutchan12-Oct-13 5:09
mveRichard MacCutchan12-Oct-13 5:09 
GeneralRe: visual studio 2008 QT project with c++ Pin
Mkhitar Sargsyan13-Oct-13 23:35
Mkhitar Sargsyan13-Oct-13 23:35 
GeneralRe: visual studio 2008 QT project with c++ Pin
Richard MacCutchan14-Oct-13 0:00
mveRichard MacCutchan14-Oct-13 0:00 
GeneralRe: visual studio 2008 QT project with c++ Pin
Mkhitar Sargsyan14-Oct-13 0:34
Mkhitar Sargsyan14-Oct-13 0:34 
GeneralRe: visual studio 2008 QT project with c++ Pin
Richard MacCutchan14-Oct-13 1:02
mveRichard MacCutchan14-Oct-13 1:02 
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 

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.