Void CSCommDlg: : OnComm ()
{
The VARIANT variant_inp;
COleSafeArray safearray_inp;
LONG len, k;
BYTE rxdata [2048].//set An 8-bit BYTE array integerthat is not signed.
Cstrings strtemp;
If (RXDataRefreshFlg==TRUE)
{
M_strRXData. Empty ();
RXDataRefreshFlg=FALSE;
}
If (m_ctrlComm GetCommEvent ()==2)//event value of 2 signifies a character
the receive buffer{
Variant_inp=m_ctrlComm. GetInput ();//read buffer
Safearray_inp=variant_inp;//the VARIANT type variables into ColeSafeArray type
Len=safearray_inp. GetOneDimSize ();//to get effective data length
for(k=0; K
for(k=0; K
BYTE bt=* (char *) (rxdata + k);//character
Strtemp. The Format (" % c ", bt);//the character into temporary variables strtemp store
M_strRXData +=strtemp;//add receive corresponding string edit box
}
}
Int I=m_strRXData. GetLength ();
If (m_strRXData GetLength ()==58)
The SendMessage (USER_RXDATA, 0, 0);//message response function for handling with
Strtemp. ReleaseBuffer ();
return;
}
Run for a moment there
0 x77c12a16 instruction references 0 x00001000 this memory cannot be read
This is why seek guidance thank you
758407526 qq
CodePudding user response:
Find a ready-made components used, such as VictorComm