471,337 Members | 1,444 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

Help needed with POSTMESSAGE using C#

(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
From: Srinivasa Ra

Posted by a user from .NET 247 (http://www.dotnet247.com/)

Jul 21 '05 #1
0 919

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Paul | last post: by
1 post views Thread by ayiiq180 | last post: by
15 posts views Thread by James | last post: by
12 posts views Thread by Wilfried Mestdagh | last post: by
1 post views Thread by Michael D. Reed | last post: by
reply views Thread by Srinivasa Ra via .NET 247 | last post: by
10 posts views Thread by Sergei | last post: by
2 posts views Thread by lgbjr | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.