Home > Software engineering >  MFC call serialport class can send but not receive serial communication data
MFC call serialport class can send but not receive serial communication data

Time:10-01

Now want to take advantage of serialport class for serial communication in the MFC dialog application, I shall be carried out in accordance with the http://blog.csdn.net/weixinhum/article/details/48213883 add header file source files, build the message response function and a series of operation, can realize send data, but always can't receive data, who did??????
 LRESULT IO: : OnComm (WPARAM ch, LPARAM port) 
{
Cstrings STR.
STR. The Format (" % 02 x ", ch);
SetDlgItemText (IDC_RECEIVED, STR);
Hahahahaha MessageBox (" ");
return 0;
}

CodePudding user response:

It is recommended to use portmon auxiliary software debugging serial communication program,

CodePudding user response:

Initialize the serial port Settings window when a pointer, the window class custom WM_COMM_RXCHAR message
You may be a custom message out of the question, the search dialog box under the custom message

CodePudding user response:

http://blog.csdn.net/a29562268/article/details/68955729

You can use this method
  • Related