Solved

Handling COM port under NT service

Posted on 1998-03-23
2
163 Views
Last Modified: 2010-04-06
Hi All,

I've got a big problem. I wrote a service under WINNT which      
asks the SERIAL Port, and put the characters into a file.
The problem is, I don't know when is data in the input buffer. My program contains a loop which never ends and the CP usage is nearly 100%. As far as I know, the sender sends a signal which indicates that the data is valid. How can I mask it?
Is there any solution?

Thanks in advance

ANdrew
0
Comment
Question by:bandi081497
2 Comments
 
LVL 3

Expert Comment

by:altena
ID: 1360726
Remove the loop, check out the "WaitCommEvent" function
in the Win32 Help/documentation.

You can have the OS "wake your progam" whenever something
interesting happens at the COMM port.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1360727
Hi bandi,

Well, maybe this helps, it is a freeware component! So if you want to write it on your own, be my guest, but then I can't help you. I use this component already a long time and it works perfectly!!! Really I don't think it's nessecarry to put all your time in writing such a component on your own. It's even with source so..... I let it up to you to decide if you want to use this component are not. If not just reject my answer... but really, have first a glimp at it before you do!!!

author : M. Cocco.
E-mail: d3k@mdnet.it
URL   : http://www.mdlive.com/d3k/
--------------------------------------

Regards, Zif.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question