Menu

232 loop back test

2002-08-06
2012-09-26
  • Nobody/Anonymous

    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);

     
    • Nobody/Anonymous

      i figured it out with the help of nobody

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.