Article View: borland.public.cppbuilder.nativeapi
Article #3464COM Port Issue
From: Jeff
Date: Wed, 14 Jun 2006 15:39
Date: Wed, 14 Jun 2006 15:39
15 lines
1529 bytes
1529 bytes
We've got a program that communicates via an ASCII protocol through the COM port on the computer. We obtain a handle to the port and use file I/O to interact with the buffer. The problem we're having is that we can't test the buffer for data without pulling the data out of the buffer. The code below is a segment that is done to see if data has been returned, but ReadFile() pulls out the data in the buffer. Is there a way to test for data in the buffer without pulling it out? Err_Ret_Code = (ReadFile(TShComm, InBuff, 10, &dwBytesRead, NULL)); if (InBuff[0] == '\0') //If no data is returned then return -1 Err_Ret_Code = -1; Thanks, Jeff
Technical Details
Message-ID:
<44902db2@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8d933165dffecbd7,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Jeff" <Jeff@nospam.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: COM Port Issue Date: Wed, 14 Jun 2006 09:39:28 -0600 Lines: 17 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 NNTP-Posting-Host: 206.104.31.217 Message-ID: <44902db2@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1150299570 206.104.31.217 (14 Jun 2006 08:39:30 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail