I've got a button on a dialog window which sends
off two strings over the net. But I'd like to stop
the process after the first string in order to listen
if a response has come.
1. I can't put //wait for an answer// into a worker thread becauseCode:void MyDlg::OnBtn1() { SendString(s1); // wait for an answer// SendString(s2); } . . void MyDlg::OnResponseArrived() { // let the OnBtn1() routine continue // }
the rest of the OnBtn1() thread will continue anyway.
2. And a worker thread is out of the question because the
MyDlg object is inaccessible.
3. A CWinThread object can't work because how can it
communicate with MyDlg?
With SendMessage from a CWinThread object
MyDlg will wait for OnBtn1() to finish before reacting to
SendMessage anyway.
Any ideas?




Reply With Quote