PostMessage won't work in C#?? Does any one has any clue????
Posted on 2005-03-10
I am trying to develop an appication that uses serial port a lot.
I am trying to create a thread (say SerialReceiveThread) that
indefinitely waits for the incoming data at the serial port instead of
polling the Serial port for the data (Which I think is very inefficent).
When the data is available, it should inform the UI thread with the data received.
I am trying to do the communication from SerialReceiveThread to UI thread
by using POSTMESSAGE, POSTTHREADMESSAGE, or even tried SENDMESSAGE. Surprisingly,
I don't see any compilation errors but the applicaion as a whole won't work.
When I override the PreProcessMessage() or WndProc() function and set a breakpoint,
I don't see any messages coming to these functions though the other thread appears
to be posting the messages.
Any ideas would be appreciated.