Polling a serial connection and updating a SDI FormView.

I have a serial connection that I would like to poll in my SDI application.
How can I run my polling function in the background to update the controls on my dialog view?
Can you please direct me to where I can find information about this or where I could find some example?

Thank you for your help with this.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vinayak KumbarSr Program ManagerCommented:

U can create a thread for monitoring the serial port. Then it will keep on monitoring the port, whenever a message comes, that can display tha data into the edit box of the dialog. I can give U the sample code ( if u give me ur emailID.)

Also ckeck it out in

Try them out.
Vinayak KumbarSr Program ManagerCommented:

I will give the steps.
1. Have the handle for the COM port to be opened as
    HANDLE            g_hPortHandle;

2. Then open the port using CreateFile(...);
3. use SetCommMask(...)
4. use SetCommState(...);
5. use SetCommTimeouts(...)
6. use AfxBeginThread(), to launch Ur thread.
7. In the thread create the event as
    OVERLAPPED overLapped;      //Overlapped Structure
    //Create The Event
    overLapped.hEvent = CreateEvent(NULL, FALSE, FALSE,     NULL);
8. Wait fo rthe com event using
9. Whenever U get EV_RXCHAR event, read the buffer using     ReadFile and store/diplay it.

For using all these functions, u have fill the required structures with proper values.

That is the basic flow.
Hope this helps u (I have a simple sample to monitor the incoming data from the COM port)


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
drodgersAuthor Commented:
Thank you again VinExpert for your help.  I would like to look at your sample application if you don't mind.  My email address is dionrodgers@hotmail.com.  I wish you a warm holiday.
Vinayak KumbarSr Program ManagerCommented:

Thanks, I wish the same to U.
I have sent u the simple sample.
Check it out

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.