1. Add the initialization code in oninitdialog ().
Bool cscommtestdlg: oninitdialog () {cdialog: oninitdialog (); // todo: add additional initialization code m_ctrlcomm.put_commp ORT (1); merge (1024); merge (512 ); m_ctrlcomm.put_settings (_ T ("9600, N, 8, 1"); If (! Values () m_ctrlcomm.put_portopen (true); values (1); m_ctrlcomm.put_inputlen (0); m_ctrlcomm.get_input (); Return true; // return true unless focus is set to the control}
2. Add the receiving code in oncommmscomm1.
Void cscommtestdlg: oncommmscomm1 () {// todo: add the message processing program code variant variant_6b; cstring strtemp; If (m_ctrlcomm.get_commevent () = 2) {variant_indium = m_ctrlcomm.get_input (); strtemp = variant_indium; m_streditrxdata + = strtemp;} updatedata (false );}
3. Add the sending code in onbnclickedbuttonmunualsend ().
Void cscommtestdlg: onbnclickedbuttonmunualsend () {// todo: add the control notification handler code updatedata (true); m_ctrlcomm.put_output (colevariant (m_stredittxdata ));}