Enrico,
IF you have COM1 in your micro, could you try this code for a COM port that doesn't exist ?
I'm having the problem when I try to do an OpenComm( cPort, 1024, 10 ), for a COM port that doesn't exist in my computer. The function returns -1, but each time I try, CPU use is increased quickly.