S
Sylvain
Hi everybody !
I need some help in programming an RS232 serial interface.
Opening a com port upper than "COM9:" (for example "COM10:", "COM11:"
etc)returns ERROR_INVALID_NAME error.
Details:
I use C++ with MFC with Wisual Studio 6.0 on XP.
The example code:
-----------------------------------------------------------------
m_hPort = CreateFile (lpszPortName, // Pointer to name of the
port
GENERIC_READ | GENERIC_WRITE,
// Access (read/write) mode
0, // Share mode
NULL, // Pointer to security
attribute
OPEN_EXISTING, // How to open
0, // Port attributes
NULL); // Handle to port with
attribute
With lpszPortName from "COM1:" to "COM9:" it works well.
With lpszPortName equal to "COM10:" and more error 123
ERROR_INVALID_NAME occurs !
I tried in HyperTerminal, and I hav no problem to open com port 10,
11, 12 ...
Any ideas what causes the Port to respond with "INVALID_NAME"`?
Help is greatly appreciated.
Thanks in advance,
bye,
Sylvain
I need some help in programming an RS232 serial interface.
Opening a com port upper than "COM9:" (for example "COM10:", "COM11:"
etc)returns ERROR_INVALID_NAME error.
Details:
I use C++ with MFC with Wisual Studio 6.0 on XP.
The example code:
-----------------------------------------------------------------
m_hPort = CreateFile (lpszPortName, // Pointer to name of the
port
GENERIC_READ | GENERIC_WRITE,
// Access (read/write) mode
0, // Share mode
NULL, // Pointer to security
attribute
OPEN_EXISTING, // How to open
0, // Port attributes
NULL); // Handle to port with
attribute
With lpszPortName from "COM1:" to "COM9:" it works well.
With lpszPortName equal to "COM10:" and more error 123
ERROR_INVALID_NAME occurs !
I tried in HyperTerminal, and I hav no problem to open com port 10,
11, 12 ...
Any ideas what causes the Port to respond with "INVALID_NAME"`?
Help is greatly appreciated.
Thanks in advance,
bye,
Sylvain