'SetWindowTextA' : is not a member of 'CString'
long TX_count=0;
void CSCOMMDlg::OnButtonManualsend()
{
// TODO: Add your control notification handler code here
if(m_Port.m_hComm==NULL)
{
m_ctrlAutoSend.SetCheck(0);
AfxMessageBox("串口没有打开,请打开串口");
return;
}
else
{
UpdateData(TRUE);
if(m_ctrlHexSend.GetCheck())
{
char data[512];
int len=Str2Hex(m_strSendData,data);
m_Port.WriteToPort(data,len);
TX_count+=(long)((m_strSendData.GetLength()+1)/3);
//m_Port.WriteToPort(hexdata);
}
else
{
m_Port.WriteToPort((LPCTSTR)m_strSendData); //发送数据
TX_count+=m_strSendData.GetLength();
}
CString strTemp;
strTemp.Format("TX:%d",TX_count);
m_ctrlTXCount.SetWindowText(strTemp);
}
}