Click here to Skip to main content
15,903,175 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: string problem??? Pin
RobJones10-Feb-06 8:54
RobJones10-Feb-06 8:54 
AnswerRe: string problem??? Pin
Maximilien10-Feb-06 9:12
Maximilien10-Feb-06 9:12 
AnswerRe: string problem??? Pin
Demonware66610-Feb-06 15:16
Demonware66610-Feb-06 15:16 
QuestionInteractive SQL Tool (using ODBC) question. Pin
Blakiston10-Feb-06 7:31
Blakiston10-Feb-06 7:31 
QuestionVB macros Pin
skk64302n10-Feb-06 7:29
skk64302n10-Feb-06 7:29 
QuestionError in code Pin
zahid_ash10-Feb-06 6:50
zahid_ash10-Feb-06 6:50 
QuestionRe: Error in code Pin
David Crow10-Feb-06 9:24
David Crow10-Feb-06 9:24 
QuestionLooking for solid C+Tree or C*-Tree source Pin
Joe Woodbury10-Feb-06 6:27
professionalJoe Woodbury10-Feb-06 6:27 
AnswerRe: Looking for solid C+Tree or C*-Tree source Pin
Jim Crafton10-Feb-06 6:33
Jim Crafton10-Feb-06 6:33 
GeneralRe: Looking for solid C+Tree or C*-Tree source Pin
Joe Woodbury10-Feb-06 6:39
professionalJoe Woodbury10-Feb-06 6:39 
AnswerRe: Looking for solid C+Tree or C*-Tree source Pin
EXTEIDE10-Feb-06 6:40
EXTEIDE10-Feb-06 6:40 
GeneralRe: Looking for solid C+Tree or C*-Tree source Pin
Joe Woodbury10-Feb-06 6:47
professionalJoe Woodbury10-Feb-06 6:47 
GeneralRe: Looking for solid C+Tree or C*-Tree source Pin
EXTEIDE10-Feb-06 7:05
EXTEIDE10-Feb-06 7:05 
AnswerRe: Looking for solid C+Tree or C*-Tree source Pin
Jörgen Sigvardsson10-Feb-06 12:21
Jörgen Sigvardsson10-Feb-06 12:21 
QuestionHelp With VC++ SOcket Programming using MFCs Pin
alienattack10-Feb-06 6:13
alienattack10-Feb-06 6:13 
AnswerRe: Help With VC++ SOcket Programming using MFCs Pin
EXTEIDE10-Feb-06 6:24
EXTEIDE10-Feb-06 6:24 
AnswerRe: Help With VC++ SOcket Programming using MFCs Pin
ThatsAlok13-Feb-06 21:38
ThatsAlok13-Feb-06 21:38 
QuestionProper way to terminate a thead? Pin
masnu10-Feb-06 4:49
masnu10-Feb-06 4:49 
AnswerRe: Proper way to terminate a thead? Pin
Roger Stoltz10-Feb-06 5:24
Roger Stoltz10-Feb-06 5:24 
Never call AfxEndThread, or any similar function. It's bound create problems.

1.
What happens here is that the compiler optimizes away the m_bRunning in your thread since the value is not changed inside the while statement.
Fix this by declaring the m_bRunning variable as 'volatile'.

2.
I assume you start your thread with a call to AfxBeginThread.
If so, you should create it suspended and set the CWinThread::m_bAutoDelete to false to be able to wait for the thread to finish. Delete the CWinThread pointer that you got from AfxBeginThread in your StopThread function.
If you don't do this, a race condition will occur that may result in the thread handle you are waiting for is invalid.

Hope this helps
--
Roger


It's supposed to be hard, otherwise anybody could do it!
GeneralRe: Proper way to terminate a thead? Pin
masnu10-Feb-06 6:42
masnu10-Feb-06 6:42 
AnswerRe: Proper way to terminate a thead? Pin
Stephen Hewitt11-Feb-06 0:25
Stephen Hewitt11-Feb-06 0:25 
QuestionList of error codes Pin
Spykraft10-Feb-06 4:04
Spykraft10-Feb-06 4:04 
AnswerRe: List of error codes Pin
toxcct10-Feb-06 4:08
toxcct10-Feb-06 4:08 
GeneralRe: List of error codes Pin
Spykraft10-Feb-06 4:18
Spykraft10-Feb-06 4:18 
QuestionRe: List of error codes Pin
David Crow10-Feb-06 4:26
David Crow10-Feb-06 4:26 

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.