When you use WinAPI to open serial port with number larger than 9 (e.g.: COM10) the CreateFile function may (will?) fail, if the port name is given straight.

The proper way to specify the port is to provide the \\.\ sequence before port name, e.g.: \\.\COM10

C/C++ example: handle = CreateFile("\\\\.\\COM11", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);