Discussion Locked

Vicual C++ 6.0, maximum serial ports

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I develop with Visual C 6.0 enterprise edition, under NT server 4.0. I have added a multi-serial port to extend system capacity (8-port digiboard). Although I can access all ports from a hyperterminal session, I am unable to access a serial port higher than COM9 from a Visual C developed application. Any attempt to access COM10 or higher using CreateFile will prompt a return code of 2 (file not found). Is it a limitation of Visual C, or did I miss something here?

3 replies

by gspecht

Check to make sure that the value returned from CreateFile equates to the defined macro INVALID_FILE_HANDLE.

If this is the case, then use the following character array;

"\\\\.\\COMx"

instead of;

"COMx"

This should work for all ports including ports 1 - 9, as well as ports 10 an up.

This discussion is closed to new replies.