Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question[Message Deleted] Pin
mini_25068914-Mar-09 7:56
mini_25068914-Mar-09 7:56 
AnswerRe: help me!!!!!!!! Pin
Stuart Dootson14-Mar-09 8:00
professionalStuart Dootson14-Mar-09 8:00 
GeneralRe: help me!!!!!!!! Pin
NeoAks00714-Mar-09 8:04
NeoAks00714-Mar-09 8:04 
AnswerRe: help me!!!!!!!! Pin
NeoAks00714-Mar-09 8:02
NeoAks00714-Mar-09 8:02 
QuestionHow to delete handles of a thread created with AfxBeginThread Pin
keret14-Mar-09 7:29
keret14-Mar-09 7:29 
AnswerRe: How to delete handles of a thread created with AfxBeginThread Pin
Stuart Dootson14-Mar-09 7:58
professionalStuart Dootson14-Mar-09 7:58 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
keret14-Mar-09 9:51
keret14-Mar-09 9:51 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
Stuart Dootson14-Mar-09 10:36
professionalStuart Dootson14-Mar-09 10:36 
keret wrote:
But the 68B and 46B blocks are still there


Implies you have a thread object and a string that you haven't deleted.

keret wrote:
Now I will try to find a way to terminate the threads. If you have a solution for that, don't keep it!


You could use a global boolean-ish variable. You would set it using InterlockedExchange[^] and read as you would any other variable.

Set it to zero before any threads are started and to one when you want to exit. Use this code to set it (let's presume it's called letsExitNow)

InterlockedExchange(&letsExitNow, 1);


Now, in each thread, you would change your with loop to somethig like this:

while (!letsExitNow && IsWindow(pInfo->hMonitoredWindow))


In the ON_WM_DESTROY handler, wait for each thread handle to be signalled (signalled means the thread has exited) - you can use WaitForSingleObject[^] or WaitForMultipleObjects[^] to do that.

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
keret14-Mar-09 11:17
keret14-Mar-09 11:17 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
Stuart Dootson14-Mar-09 11:52
professionalStuart Dootson14-Mar-09 11:52 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
keret15-Mar-09 4:03
keret15-Mar-09 4:03 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
Stuart Dootson15-Mar-09 6:07
professionalStuart Dootson15-Mar-09 6:07 
GeneralRe: How to delete handles of a thread created with AfxBeginThread Pin
keret15-Mar-09 9:55
keret15-Mar-09 9:55 
QuestionTemplate Class Issues in C++. Pin
NeoAks00714-Mar-09 7:24
NeoAks00714-Mar-09 7:24 
AnswerRe: Template Class issues in C++. Pin
N a v a n e e t h14-Mar-09 7:31
N a v a n e e t h14-Mar-09 7:31 
GeneralRe: Template Class issues in C++. Pin
NeoAks00714-Mar-09 7:38
NeoAks00714-Mar-09 7:38 
GeneralRe: Template Class issues in C++. Pin
N a v a n e e t h14-Mar-09 7:45
N a v a n e e t h14-Mar-09 7:45 
QuestionRe: Template Class issues in C++. Pin
NeoAks00714-Mar-09 7:50
NeoAks00714-Mar-09 7:50 
AnswerRe: Template Class issues in C++. Pin
Stuart Dootson14-Mar-09 8:07
professionalStuart Dootson14-Mar-09 8:07 
AnswerRe: Template Class issues in C++. Pin
N a v a n e e t h14-Mar-09 8:14
N a v a n e e t h14-Mar-09 8:14 
QuestionRe: Template Class issues in C++. Pin
NeoAks00714-Mar-09 8:32
NeoAks00714-Mar-09 8:32 
NewsRe: Template Class issues in C++. Pin
NeoAks00714-Mar-09 9:16
NeoAks00714-Mar-09 9:16 
AnswerRe: Template Class issues in C++. Pin
Stuart Dootson14-Mar-09 9:38
professionalStuart Dootson14-Mar-09 9:38 
QuestionRe: Template Class issues in C++. Pin
NeoAks00714-Mar-09 9:58
NeoAks00714-Mar-09 9:58 
AnswerRe: Template Class issues in C++. Pin
Stuart Dootson14-Mar-09 10:20
professionalStuart Dootson14-Mar-09 10:20 

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.