Trouble opening connection to serial port through "CreateFile"
Posted on 2004-09-07
I am trying to get access to my serial port through the CreateFile Method like this
HANDLE portHandle = CreateFile( "COM2", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING,FILE_FLAG_OVERLAPPED,0);
but it keeps giving me an invalid handle. I suspect it is the name of the port. I want to access comm port 2 (like if I were in hyperterminal it would be com2) but have no clue if I am using the right name here. Any help would be greatly appreciated.