I want to do, but don't know how in MFC
I want to do, but don't know how in MFC
As I said before, if you are sitting in a busy loop or on a blocking function call, your windows loop will not be able to receive and process the message associated with the button press. This will be the case in MFC as well as regular Win32 programming.
If Windows cannot process the message, it cannot act on it. Thus, your UI is unresponsive. That is why the design is poor. I would have the blocking calls/busy loops in another thread, leaving the UI in the main thread, and active at all times.
This is a classic case where threading is useful.
Threading is not inherently difficult, (I have a simple introductory tutorial on my site, here), but be aware that MFC had it's own threading support classes.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
Look at CSocket and CAsyncSocket.
The socket will listen automatically and notify your app when data events happen ie incomming data == OnReceive().
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Does anyone know of a simple tutorial/book on how to creat multi-thread in MFC?