Click here to Skip to main content
15,887,683 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
QuestionC4309 warning Pin
Rakesh530-Jul-10 3:45
Rakesh530-Jul-10 3:45 
AnswerRe: C4309 warning Pin
Cedric Moonen30-Jul-10 3:52
Cedric Moonen30-Jul-10 3:52 
GeneralRe: C4309 warning Pin
Rakesh530-Jul-10 4:10
Rakesh530-Jul-10 4:10 
GeneralRe: C4309 warning Pin
Chris Losinger30-Jul-10 4:12
professionalChris Losinger30-Jul-10 4:12 
GeneralRe: C4309 warning Pin
Rakesh530-Jul-10 4:18
Rakesh530-Jul-10 4:18 
GeneralRe: C4309 warning Pin
Cedric Moonen30-Jul-10 4:24
Cedric Moonen30-Jul-10 4:24 
GeneralRe: C4309 warning Pin
Chris Losinger30-Jul-10 4:25
professionalChris Losinger30-Jul-10 4:25 
QuestionHow reduce build time of the project? Pin
ganesh.dp30-Jul-10 3:04
ganesh.dp30-Jul-10 3:04 
AnswerRe: How reduce build time of the project? Pin
Sauro Viti30-Jul-10 3:19
professionalSauro Viti30-Jul-10 3:19 
AnswerRe: How reduce build time of the project? Pin
Maximilien30-Jul-10 4:46
Maximilien30-Jul-10 4:46 
AnswerRe: How reduce build time of the project? Pin
Abhi Lahare30-Jul-10 8:15
Abhi Lahare30-Jul-10 8:15 
AnswerRe: How reduce build time of the project? Pin
Aescleal30-Jul-10 20:49
Aescleal30-Jul-10 20:49 
QuestionWriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
learningvisualc30-Jul-10 2:59
learningvisualc30-Jul-10 2:59 
AnswerRe: WriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
Cool_Dev30-Jul-10 3:37
Cool_Dev30-Jul-10 3:37 
AnswerRe: WriteFile returning zero and GetLastError returning 997(ERROR_IO_PENDING) Pin
Xequen30-Jul-10 4:09
Xequen30-Jul-10 4:09 

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.