Click here to Skip to main content
15,901,205 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreate the CWnd Pin
TrungHuynh31-May-04 13:12
TrungHuynh31-May-04 13:12 
GeneralRe: Create the CWnd Pin
Maarten Kools31-May-04 14:27
professionalMaarten Kools31-May-04 14:27 
GeneralRe: Create the CWnd Pin
Diddy1-Jun-04 1:49
Diddy1-Jun-04 1:49 
Generalimage processing Pin
giti31-May-04 11:18
giti31-May-04 11:18 
Generalmultiple RPCs in one process. Pin
leonmccalla@hotmail.com31-May-04 9:36
leonmccalla@hotmail.com31-May-04 9:36 
GeneralThread Handle Query Pin
Nirav Doshi31-May-04 9:30
Nirav Doshi31-May-04 9:30 
GeneralRe: Thread Handle Query Pin
Michael Dunn31-May-04 12:26
sitebuilderMichael Dunn31-May-04 12:26 
GeneralRe: Thread Handle Query Pin
Nirav Doshi31-May-04 20:39
Nirav Doshi31-May-04 20:39 
Michael Dunn wrote:
If your handle is becoming invalid (is WaitForMultipleObjects() returning an error?)

Yes!

I'll explain here:

Suppose I have 12 jobs. Since my MAX_THREADS is 5, 7 jobs are pending the first time WaitForMultipleObjects() is called. As and when my WaitForMultipleObjects() returns, I get back to assigning another job to that (returned) thread. I have another small loop just before calling WaitForMultipleObjects() where I an checking if by the time I was assigning another job to the first thread that returned, if any other thread has finished. To find if any other thread has finished working till I am assigning another job, I am checking if the thread handle is valid/invalid. Here I am getting the thread handle sometimes as NULL (0x00000000) or some junk (0xfeeeeeee, etc.) so I am unable to check for it.

I have another method (which I didn't really like!), which is using a thread variable to give the current thread state. But I hope, there's some way to check if the thread handle is valid/invalid.

Thanks,

Nirav Doshi

* Don't wish it was easier, wish you were better! *
GeneralRe: Thread Handle Query Pin
Diddy1-Jun-04 1:54
Diddy1-Jun-04 1:54 
GeneralRe: Thread Handle Query Pin
Nirav Doshi1-Jun-04 2:13
Nirav Doshi1-Jun-04 2:13 
GeneralRe: Thread Handle Query Pin
Diddy1-Jun-04 5:10
Diddy1-Jun-04 5:10 
GeneralRe: Thread Handle Query Pin
Nirav Doshi1-Jun-04 8:03
Nirav Doshi1-Jun-04 8:03 
GeneralRe: Thread Handle Query Pin
Diddy1-Jun-04 10:27
Diddy1-Jun-04 10:27 
GeneralCostom Draw Problem!!! Pin
VirgoCI31-May-04 8:24
VirgoCI31-May-04 8:24 
GeneralRe: Costom Draw Problem!!! Pin
Antti Keskinen31-May-04 11:46
Antti Keskinen31-May-04 11:46 
GeneralRe: Costom Draw Problem!!! Pin
VirgoCI31-May-04 17:48
VirgoCI31-May-04 17:48 
Generalsmtp question Pin
includeh1031-May-04 8:16
includeh1031-May-04 8:16 
GeneralRe: smtp question Pin
bryce31-May-04 15:10
bryce31-May-04 15:10 
GeneralProblem with SetTextColor Pin
Aviv Halperin31-May-04 7:50
Aviv Halperin31-May-04 7:50 
GeneralRe: Problem with SetTextColor Pin
Brian D31-May-04 8:15
Brian D31-May-04 8:15 
GeneralRe: Problem with SetTextColor Pin
includeh1031-May-04 8:21
includeh1031-May-04 8:21 
GeneralRe: Problem with SetTextColor Pin
f6431-May-04 8:22
f6431-May-04 8:22 
GeneralRe: Problem with SetTextColor Pin
Aviv Halperin31-May-04 9:16
Aviv Halperin31-May-04 9:16 
Generaldocumentation of jpeg format Pin
includeh1031-May-04 6:54
includeh1031-May-04 6:54 
GeneralRe: documentation of jpeg format Pin
Nirav Doshi31-May-04 9:11
Nirav Doshi31-May-04 9:11 

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.