Solved

Handling COM port under NT service

Posted on 1998-03-23
2
164 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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