S
Srinivasa Ra via .NET 247
(Type your message here)
I am writing an application that does lot of read/write's withcomputer's serial port. The application as a whole is workingfine.
Current Approach: I have a Timer that checks once every millisecond to see if there is any data avaialable to read at theserial port. If so then reads it. The serial port is openedwithout OVERLAPPING.
TRYING TO GET TO: I don't think polling serial port every millisecond is a good approach. I am thinking of creating a seperatethread that waits for data to come at the serial port. When thedata arrives, it should inform it to the main thread which ishandling the User Interface. For this, I am trying to use Win32API function POSTMESSAGE to post data to the main form window'smessage loop. I have overriden both PreProcessMessage() andWndProc() functions. But no use. I never get that message to themain thread. But no compilation errors. Am I doing somethingwrong here?? I don't want to use delegates, threadpool stuff.
Any suggestions would be highly appreciated.
Thank you all
I am writing an application that does lot of read/write's withcomputer's serial port. The application as a whole is workingfine.
Current Approach: I have a Timer that checks once every millisecond to see if there is any data avaialable to read at theserial port. If so then reads it. The serial port is openedwithout OVERLAPPING.
TRYING TO GET TO: I don't think polling serial port every millisecond is a good approach. I am thinking of creating a seperatethread that waits for data to come at the serial port. When thedata arrives, it should inform it to the main thread which ishandling the User Interface. For this, I am trying to use Win32API function POSTMESSAGE to post data to the main form window'smessage loop. I have overriden both PreProcessMessage() andWndProc() functions. But no use. I never get that message to themain thread. But no compilation errors. Am I doing somethingwrong here?? I don't want to use delegates, threadpool stuff.
Any suggestions would be highly appreciated.
Thank you all