我在一个类里面定义了一个for worker线程的static函数,
我把类的指针传进去,然后在这个static函数里面调用类的成员函数,成员函数
里面用::sendmessage()发送一个消息给另外一个窗口,调试的时候发现,老是在
::sendmessage()的时候程序就死在那里了,哪位有经验的大哥指点一下小弟啊.
谢谢拉
我把类的指针传进去,然后在这个static函数里面调用类的成员函数,成员函数
里面用::sendmessage()发送一个消息给另外一个窗口,调试的时候发现,老是在
::sendmessage()的时候程序就死在那里了,哪位有经验的大哥指点一下小弟啊.
谢谢拉
还忘了说一点就是,在sendmessage的时候有另外一个线程(同一个static函数)通过该类的指针在等待同步信号,不知道会不会有影响啊。有哪位大哥来指点下吗?谢谢
If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message. However, the sending thread will process incoming nonqueued messages while waiting for its message to be processed. To prevent this, use SendMessageTimeout with SMTO_BLOCK set. For more information on nonqueued messages, see Nonqueued Messages.