Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages
Started by Boba
Mon, 31 Dec 2007 00:49
Comm port 1
Author: 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
Re: Comm port 1
Author: Remy Lebeau (TeamB)
Date: Mon, 31 Dec 2007 06:06
Date: Mon, 31 Dec 2007 06:06
13 lines
1262 bytes
1262 bytes
"Boba" <Boba@somewhere.world> wrote in message news:477839b7@newsgroups.borland.com... > if(!GetCommConfig(h,&cmncnf,&dw)) > ShowMessage(IntToStr(GetLastError())); > //1=ERROR_INVALID_FUNCTION Which version of Windows are you running your code on? GetCommConfig() is supported only on Windows 2000 and later. Gambit
Re: Comm port 1
Author: Boba
Date: Mon, 31 Dec 2007 17:47
Date: Mon, 31 Dec 2007 17:47
16 lines
1517 bytes
1517 bytes
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message news:477886bb$1@newsgroups.borland.com... > ... > Which version of Windows are you running your code on? GetCommConfig() is > supported only on Windows 2000 and later. > This probem occurs on some Windows2000Pro 5.00.2195: I had no problem with Windows <= 98SE and >= 2K.Sp4. Right now I have 2 pcs with same build 2KPro unpatched next to each other and I've been 'having this fun' for the last 3 days (and nights!). One of these pcs shows the problem, the other does not; the machines are of different hardware and have some MS licenced software installed (serial drivers are binary identical). Thanks.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads