Unable to open serial port above com9 on winxp

J

Jerry

I've got apps that use multiple serial ports. Ports are opened using
CreateFile. I've found that under windows XP, any attempt to open a port
above com9 (com10, 11, 12, etc) fails ... even when device manager shows the
comm port as available and active. Anyone else run into this problem and/or
have a solution? This code works fine under Win95, 98, ME, etc ... Any
insight would be greatly appreciated.

Jerry
 
S

Si Ballenger

I've got apps that use multiple serial ports. Ports are opened using
CreateFile. I've found that under windows XP, any attempt to open a port
above com9 (com10, 11, 12, etc) fails ... even when device manager shows the
comm port as available and active. Anyone else run into this problem and/or
have a solution? This code works fine under Win95, 98, ME, etc ... Any
insight would be greatly appreciated.

I've found that XP doesn't like a program I made with quickbasic
that opens the com port like a file (no problem on 95, 98, 2K).
It could be the drivers for your serial gizmo. I think the MSComm
control supplied with VB6 allows only 16 comports to be used. It
can be hacked to use more with a hex editor. You may want to look
for gizmos that allow for more serial ports (Stallion, edgeport,
etc.)
 
T

Thomas Lutz

When you feed the name of the COM port to the CreateFile call you need
to use the syntax:
\\.\COMn
instead of simply COMn
For example, if you call the CreateFile function using the following,
it will work with all COM ports up to COM256

CreateFile("\\.\COM10", GENERIC_READ Or GENERIC_WRITE, etc....

For more serial I/O tips tricks and free utilities please visit
www.taltech.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top