Article View: borland.public.cppbuilder.nativeapi
Article #3474Re: Com port error
From: JD
Date: Fri, 16 Jun 2006 15:19
Date: Fri, 16 Jun 2006 15:19
37 lines
2157 bytes
2157 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
> WaitCommEvent() works on non-overlapped ports as well.
After some searching, it's been decided that the thread should
not use WaitCommEvent but I can use WaitForSingleObjectEx. I
wasn't there for that one so what ever. I just want a test bed
for testing the thread and it escapes me.
What I'm trying to do now is open the port twice - once for
reading and another for writing but on the second call to
CreateFile, I get an Access denied error:
WCom = ::CreateFile( TEXT("COM1"),
GENERIC_WRITE,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
0,
NULL
);
RCom = ::CreateFile( TEXT("COM1"),
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL
);
Please note that I've tried what seems to me to be all logical
combinations of the dwDesiredAccess and dwShareMode.
~ JD
Technical Details
Message-ID:
<4492cbf9$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailReferences:
<4491a4c2$1@newsgroups.borland.com> <4491a6b2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,f1782b94b4ced041 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "JD" <nospam@nospam.com> Sender: "JD" <nospam@nospam.com> Reply-To: "JD" <nospam@nospam.com> Subject: Re: Com port error Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 205.188.116.136 X-Forwarded-For: 172.128.209.110 References: <4491a4c2$1@newsgroups.borland.com> <4491a6b2$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <4492cbf9$1@newsgroups.borland.com> Date: 16 Jun 2006 08:19:21 -0700 X-Trace: newsgroups.borland.com 1150471161 207.105.83.66 (16 Jun 2006 08:19:21 -0700) Lines: 38 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!reader.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail