📄 error lookupdlg.cpp
字号:
}
else if((m_Value == ErrorCode[18])||(m_Value == HexValue[18]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[18]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[19])||(m_Value == HexValue[19]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[19]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[20])||(m_Value == HexValue[20]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[20]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[21])||(m_Value == HexValue[21]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[21]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[22])||(m_Value == HexValue[22]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[22]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[23])||(m_Value == HexValue[23]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[23]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[24])||(m_Value == HexValue[24]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[24]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[25])||(m_Value == HexValue[25]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[25]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[26])||(m_Value == HexValue[26]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[26]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[27])||(m_Value == HexValue[27]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[27]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[28])||(m_Value == HexValue[28]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[28]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[29])||(m_Value == HexValue[29]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[29]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[30])||(m_Value == HexValue[30]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[30]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[31])||(m_Value == HexValue[31]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[31]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[32])||(m_Value == HexValue[32]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[32]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[33])||(m_Value == HexValue[33]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[33]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[34])||(m_Value == HexValue[34]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[34]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[35])||(m_Value == HexValue[35]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[35]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[36])||(m_Value == HexValue[36]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[36]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[37])||(m_Value == HexValue[37]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[37]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[38])||(m_Value == HexValue[38]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[38]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[39])||(m_Value == HexValue[39]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[39]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[40])||(m_Value == HexValue[40]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[40]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[41])||(m_Value == HexValue[41]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[41]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[42])||(m_Value == HexValue[42]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[42]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[43])||(m_Value == HexValue[43]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[43]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[44])||(m_Value == HexValue[44]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[44]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[45])||(m_Value == HexValue[45]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[45]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[46])||(m_Value == HexValue[46]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[46]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[47])||(m_Value == HexValue[47]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[47]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[48])||(m_Value == HexValue[48]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[48]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[49])||(m_Value == HexValue[49]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[49]);
UpdateData(FALSE);
}
else if((m_Value == ErrorCode[50])||(m_Value == HexValue[50]))
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[50]);
UpdateData(FALSE);
}
else
{
((CEdit *)GetDlgItem(IDC_MSG))->SetWindowText(ErrorMsg[51]);
UpdateData(FALSE);
}
}
void CErrorLookUpDlg::OnChangeValue()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
CString sText;
((CEdit *)GetDlgItem(IDC_Value))->GetWindowText(sText);
int nLen = sText.GetLength();
if(nLen == 0) return;
if(nLen>1)
{
if((sText[nLen-1]<32)||(sText[nLen-1]>128))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1, nLen-1);
}
if(sText[0] == '-')
{
if((((sText[nLen-1]<48)||(sText[nLen-1]>57))||(sText[1]=='0')))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1, nLen-1);
}
}
if((sText[0]>48)&&(sText[0]<=57))
{
if((sText[nLen-1]<48)||(sText[nLen-1]>57))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1,nLen-1);
}
}
}
if(nLen==1)
{
if(((sText[nLen-1]<48)||(sText[nLen-1]>57))&&(sText[nLen-1]!='-'))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1,nLen-1);
}
}
if(nLen == 2)
{
if(sText[0] == '0')
{
if((sText[1]!='x')&&(sText[1]!='X'))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1,nLen-1);
}
}
}
if(nLen>2)
{
if(((sText[nLen-1]<97)||(sText[nLen-1]>102))&&((sText[nLen-1]<65)||(sText[nLen-1]>70))
&&((sText[nLen-1]<48)||(sText[nLen-1]>57)))
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1, nLen-1);
}
}
if(nLen >10)
{
((CEdit *)GetDlgItem(IDC_Value))->SetWindowText(sText.Left(nLen-1));
((CEdit *)GetDlgItem(IDC_Value))->SetSel(nLen-1, nLen-1);
}
}
//大小写字母转换
CString swap(CString tmpstring)
{
int i;
CString upperstring;
for(i = 0; i<tmpstring.GetLength(); i++)
{
if(((tmpstring[i]>=97)&&(tmpstring[i]<=102)))
{
upperstring.Insert(i,tmpstring[i]-32);
}
else if(i==2)
{
if(tmpstring[i-1]=='X')
{
upperstring.Insert(i-1,tmpstring[i-1]+32);
}
else
{
upperstring.Insert(i,tmpstring[i]);
}
}
else
{
upperstring.Insert(i,tmpstring[i]);
}
}
return upperstring;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -