🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Helmut Giese Fri, 23 Mar 2007 21:13
How to access COM12
#2216
Author: Helmut Giese
Date: Fri, 23 Mar 2007 21:13
16 lines
1366 bytes
Hello out there,
I have a many-year-old application which handles several modems at the
same time. Now the system got once more expanded, I have to deal with
COM ports up to '12' - and I cannot open them:
- Opening with 'COM12' results in error 2: System cannot find file.
- Opening with 'COM12:' results in error 138: Syntax error in file
name.

Note: Both versions (with or without ':') work for e.g. COM1.

What I find infuriating is that stupid Hyperterminal is able to
connect to a modem via COM12 - but I am not :(

Any info or link to the correct syntax would be highly appreciated.
Best regards
Helmut Giese
Re: How to access COM12
#2217
Author: Remy Lebeau (TeamB)
Date: Fri, 23 Mar 2007 21:39
17 lines
1665 bytes
"Helmut Giese" <hgiese@ratiosoft.com> wrote in message
news:4604415e.2029877@forums.borland.com...

> I have a many-year-old application which handles several modems
> at the same time. Now the system got once more expanded, I
> have to deal with COM ports up to '12' - and I cannot open them

That is because you are not opening them correctly.  If you read the
documentation for CreateFile() at MSDN, you will see the following:

    "To specify a COM port number greater than 9, use the following
syntax: "\\\\.\\COM10". This syntax works for all port numbers and
hardware that allows COM port numbers to be specified."


Gambit
Re: How to access COM12
#2218
Author: Helmut Giese
Date: Sat, 24 Mar 2007 10:59
20 lines
1605 bytes
On Fri, 23 Mar 2007 13:39:38 -0800, "Remy Lebeau \(TeamB\)"
<no.spam@no.spam.com> wrote:

Hi Gambit,
>> I have a many-year-old application which handles several modems
>> at the same time. Now the system got once more expanded, I
>> have to deal with COM ports up to '12' - and I cannot open them
>
>That is because you are not opening them correctly.  
Yes, I supposed this to be the case :)

>If you read the
>documentation for CreateFile() at MSDN, you will see the following:
>
>    "To specify a COM port number greater than 9, use the following
>syntax: "\\\\.\\COM10". This syntax works for all port numbers and
>hardware that allows COM port numbers to be specified."
Thanks a lot, you saved me a lot of head scratching - as so often.
Have a nice weekend and best regards
Helmut Giese
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