Solved

Trapping serial com port event

Posted on 1997-12-12
3
247 Views
Last Modified: 2010-04-04
I am currently accessing the PC's serial com port in Delphi 2 using Createfile, readfile and wrirefile method. Now, I have created a buffer and whenever I read the port, I transfer the contents to the buffer. How do I trap the event whenever the serial port receives data? I am trying to avoid polling the port for data (eg using threads or timers)

By the way, I have ported my code to Delphi 3 and it seems to work fine. However, I couldn't find the createfile, writefile, etc functions that I am using. Does Delphi 3 have a different method of accessing the port, and maybe this method can help in the trapping of the event in question?

Cheers
Keith
0
Comment
Question by:keithcsl
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1353461
Well, this isn't a answer to the point. But I use a component for serial port comunications which is very good. You've got everything there what you need. (Com1..16, events, ...).
Look at it! Why inventing the wheel if it already exists?

URL   : http://www.mdlive.com/d3k/

Besides it's freeware, so it wouldn't mind just to have a look at it.

Have fun,
c.u. ZifNab;
0
 
LVL 1

Author Comment

by:keithcsl
ID: 1353462
ZifNab

Well, I guess a person who delivers the source of the answer deserves the credit. But it would also be very nice to acknowledge the other party, so here they are:

 - D3K, The Artisan Of Ware.
 - M. Cocco.

By the way, the source file is cd320108.zip

Thanks to all of you
Keith
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1353463
keithcsl,

Correct about giving credits! Offcourse, in my program I give these authors a lot of credit. I hope that everybody does this when they use components of other parties.
I didn't gave the name here, because I don't want that this site will become a commercial site...

Glad we could help you.
Zif.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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