Article View: borland.public.cppbuilder.nativeapi
Article #941Comm port 1
From: Boba
Date: Mon, 31 Dec 2007 00:49
Date: Mon, 31 Dec 2007 00:49
23 lines
1618 bytes
1618 bytes
Happy New Year to ya'll!
I have exhausted all my ideas on the following problem:
HANDLE h;
h=CreateFile("COM1",GENERIC_READ|GENERIC_WRITE,0,NULL,
OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL);
if(h==INVALID_HANDLE_VALUE) return;
COMMCONFIG cmncnf;
DWORD dw;
dw=sizeof(cmncnf);
ZeroMemory(&cmncnf,sizeof(cmncnf));
cmncnf.dwSize=sizeof(cmncnf);
cmncnf.dcb.DCBlength=sizeof(cmncnf.dcb);
//here's my problem:
if(!GetCommConfig(h,&cmncnf,&dw))
ShowMessage(IntToStr(GetLastError()));
//1=ERROR_INVALID_FUNCTION
CloseHandle(h);
For no obvious (to me) reason, all communication function
calls with this handle return FALSE. What should I be looking
for? Please help. Boba
Technical Details
Message-ID:
<477839b7@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!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,62b15d88d53c27a6,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Boba" <Boba@somewhere.world> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Comm port 1 Date: Sun, 30 Dec 2007 18:49:42 -0600 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 NNTP-Posting-Host: 65.243.37.30 Message-ID: <477839b7@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1199061431 65.243.37.30 (30 Dec 2007 16:37:11 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail