I don't know much about serial port operations but why do you wait twice in the non-overlapped version?
Code:
if (WaitCommEvent(hCom2, &dwEvtMask, NULL))
{
printf("test\n");
WaitCommEvent(hCom2, &dwEvtMask, NULL);
if (dwEvtMask == EV_RXCHAR)
{
// To do.
bRead = ReadFile(hCom2, &valRead, dwToRead, &dwRead, NULL);
bytesRead++;
}
}
Also:
Code:
char input[] = "1234567890";
...
WriteACharBuffer((char *)&input,2 );
input is already a char *, by passing its address you are getting a char ** which is why you have to cast it back to a char *.
Hope that is of some help.