Multithreading Multi-Threaded Programming
Multithreading Multi-Threaded Programming
Multithreading Multi-Threaded Programming
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Example main thread<br />
} Start the thread<br />
AfxBeginThread(ComputeThreadProc, GetSafeHwnd());<br />
} Set the start event<br />
void CComputeDlg::OnBnClickedStart()<br />
{<br />
GetDlgItem(IDC_START)->EnableWindow(FALSE);<br />
g_eventStart.SetEvent();<br />
}<br />
} Set the terminate event<br />
void CComputeDlg::OnBnClickedCancel()<br />
{<br />
g_eventKill.SetEvent();<br />
}<br />
33<br />
Advanced Windows Network <strong>Programming</strong><br />
11/11/12