Die Dateiangabe von COMx geht nur bei
COM < 10. Ab COM10 muss es anders angegeben werden - siehe
CreateFile()

Zitat von
MSDN CreateFile():
To specify a
COM port number greater than 9, use the following syntax: "\\\\.\\COM10". This syntax works for all port numbers and hardware that allows
COM port numbers to be specified.
Und nicht von der C-Syntax verwirren lassen. Du musst das als "\\.\COM42" angeben