im writing a basic program to test a 232 line with a loop back. is there so trick for writing and then reading from a com port. i take the text from an edit feild send it out read it back and post it to a second edit feild. heres how i figured to do it but it aint working:dawe@attcanada.net
im writing a basic program to test a 232 line with a loop back. is there so trick for writing and then reading from a com port. i take the text from an edit feild send it out read it back and post it to a second edit feild. heres how i figured to do it but it aint working:dawe@attcanada.net
HANDLE hCom;
hCom = CreateFile( "COM1",GENERIC_WRITE | GENERIC_READ ,0, 0, OPEN_EXISTING, 0, NULL);
char szBuffer[290];
SendMessage(input, WM_GETTEXT, sizeof szBuffer, (LPARAM) ((LPSTR) szBuffer));
WriteFile(hCom, &szBuffer, cbWritten, &cbWritten, NULL);
char szBuffer2[290];
ReadFile(hCom, &szBuffer2, cbWritten, &cbWritten, NULL);
SendMessage(_return, WM_SETTEXT, sizeof szBuffer2, (LPARAM)szBuffer2) ;
return(0);
i figured it out with the help of nobody