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

C / C++ / MFC

 
GeneralRe: Child Dialog Pin
Richard MacCutchan31-Jul-10 21:23
mveRichard MacCutchan31-Jul-10 21:23 
GeneralRe: Child Dialog Pin
Gary R. Wheeler31-Jul-10 23:43
Gary R. Wheeler31-Jul-10 23:43 
AnswerRe: Child Dialog Pin
Sauro Viti31-Jul-10 22:25
professionalSauro Viti31-Jul-10 22:25 
QuestionBalloon notification in Vista Pin
rahul.kulshreshtha30-Jul-10 20:38
rahul.kulshreshtha30-Jul-10 20:38 
Questionhow does this macro work? Pin
Amrit Kshetri30-Jul-10 16:06
Amrit Kshetri30-Jul-10 16:06 
AnswerRe: how does this macro work? Pin
Paul M Watt30-Jul-10 17:17
mentorPaul M Watt30-Jul-10 17:17 
GeneralRe: how does this macro work? Pin
Amrit Kshetri30-Jul-10 18:46
Amrit Kshetri30-Jul-10 18:46 
GeneralRe: how does this macro work? Pin
Paul M Watt30-Jul-10 19:05
mentorPaul M Watt30-Jul-10 19:05 
Questionheap corruption detected Pin
smengl30-Jul-10 8:38
smengl30-Jul-10 8:38 
AnswerRe: heap corruption detected Pin
Maximilien30-Jul-10 8:52
Maximilien30-Jul-10 8:52 
GeneralRe: heap corruption detected Pin
David Crow30-Jul-10 9:21
David Crow30-Jul-10 9:21 
AnswerRe: heap corruption detected Pin
Chuck O'Toole30-Jul-10 17:24
Chuck O'Toole30-Jul-10 17:24 
AnswerRe: heap corruption detected Pin
Aescleal30-Jul-10 21:03
Aescleal30-Jul-10 21:03 
QuestionAny interest in parallel programming 64-bit multi-core c++? Pin
rob Schultz30-Jul-10 8:35
rob Schultz30-Jul-10 8:35 
AnswerRe: Any interest in parallel programming 64-bit multi-core c++? [modified] Pin
SortaCore1-Aug-10 22:48
SortaCore1-Aug-10 22:48 
AnswerRe: Any interest in parallel programming 64-bit multi-core c++? Pin
rob Schultz6-Aug-10 19:45
rob Schultz6-Aug-10 19:45 
QuestionWAVEINCAPS help... Pin
AmbiguousName30-Jul-10 7:52
AmbiguousName30-Jul-10 7:52 
QuestionCMDIChildWndEx with its own menu Pin
SaintNeil30-Jul-10 5:17
SaintNeil30-Jul-10 5:17 
AnswerRe: CMDIChildWndEx with its own menu Pin
Richard MacCutchan30-Jul-10 6:35
mveRichard MacCutchan30-Jul-10 6:35 
AnswerRe: CMDIChildWndEx with its own menu Pin
Eugen Podsypalnikov30-Jul-10 11:02
Eugen Podsypalnikov30-Jul-10 11:02 
QuestionDisconnect from server in vc++ Pin
dilara semerci30-Jul-10 3:45
dilara semerci30-Jul-10 3:45 
AnswerRe: Disconnect from server in vc++ Pin
Moak30-Jul-10 4:21
Moak30-Jul-10 4:21 
AnswerRe: Disconnect from server in vc++ Pin
Cool_Dev30-Jul-10 4:33
Cool_Dev30-Jul-10 4:33 
if they are worker threads, use events to synchronise their termination.

in each thread
while(WaitForSingleObject(hEvent, 0) == WAIT_TIMEOUT))
{
   read some data from connection asynchronously
}
close connection and exit thread


in main UI thread,
has an event handle initially set to non signalled.
creates 'n' number of threads and store their handles in an array hThreads[]
button_click()
{
    SetEvent(m_hEvent)

    WaitForMultipeObject(n, hThreads, 1, INFINITE)
    //all threads terminated 
}


and if they are UI threads or has a message quee, use PostThreadMessage(), and wait from the main thread for their termination.
QuestionRe: Disconnect from server in vc++ Pin
dilara semerci2-Aug-10 4:38
dilara semerci2-Aug-10 4:38 
AnswerRe: Disconnect from server in vc++ Pin
Cool_Dev2-Aug-10 18:01
Cool_Dev2-Aug-10 18:01 

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.