Unable to open serial port above com9 on winxp

  • Thread starter Thread starter Jerry
  • Start date Start date
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
 
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.)
 
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
 
Back
Top