Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Socket and thread problem.HELP

kcynickcynic Member Posts: 61
I have a class derived from CWinThread, which have a CWnd* member which would recieve message from the thread. In the class also has a socket member,it would send network message to the CWnd* member.

I use such class in a Dialog,it works well.But when the main dialog create a new child dialog and show it using DoModal() function, and I want to make the child dialog correspond to the thread message and network message. In the child dialog,I send data to somewhere,but the class does send the data when the child dialog closed. Why?
Thanks

Good Luck.

Comments

  • manucpmanucp Member Posts: 34
    Modal dialogs don't have a message queue. So they aren't received until the main window message processor is working again. You should use a child window (or another thread)

    : I have a class derived from CWinThread, which have a CWnd* member
    : which would recieve message from the thread. In the class also has a
    : socket member,it would send network message to the CWnd* member.
    :
    : I use such class in a Dialog,it works well.But when the main dialog
    : create a new child dialog and show it using DoModal() function, and
    : I want to make the child dialog correspond to the thread message and
    : network message. In the child dialog,I send data to somewhere,but
    : the class does send the data when the child dialog closed. Why?
    : Thanks
    :
    : Good Luck.
    :
Sign In or Register to comment.