Hey guys, I am trying to access a serial port using the CreateFile Functions as thus
1 2
|
this->hcomm_port = CreateFile(portName,
GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, overlapped?FILE_FLAG_OVERLAPPED : 0, NULL);
|
My problem is that it returns a valid handle, but when i debug, it seems as
though the call to CreateFile runs under a thread, and the CMD does not close
after the above line is executed.
Subsequently, the returned handle to the port does not write well to the port
however, check to the INVALID_HANDLE_VALUE returns that the handle is valid, how else can i check for its validity and if it points to the write port
cause it cant write to the port properly
This is delaying a deployment of an Application badly
Help will be highly appreciated
And a call to GetLastError returns operation completed successfully