调整校正数据显示崩溃问题

This commit is contained in:
masayume 2022-04-29 11:22:55 +08:00
parent 15361bf545
commit debf85dd63
1 changed files with 10 additions and 7 deletions

View File

@ -195,7 +195,7 @@ BOOL CHuaGoCorrectDlg::OnInitDialog()
s_minute = "00";
s_second = "00";
UpdateData(FALSE);
((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)))->SetLimitText(0xffffffff);
bool ret = RefreshUSBList();
if (ret)
{
@ -424,13 +424,16 @@ void CHuaGoCorrectDlg::OnBnClickedBtnFlat()
USES_CONVERSION;
std::string c_str = StringToUtf(info);
CString pWideChar = A2T(c_str.c_str());
CString oldinfo;
UpdateData(FALSE);
((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)))->GetWindowText(oldinfo);
oldinfo += pWideChar;
((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)))->SetWindowText(oldinfo);
//CString oldinfo;
//UpdateData(FALSE);
//((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)))->GetWindowText(oldinfo);
//oldinfo += pWideChar;
//((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)))->SetWindowText(oldinfo);
auto edit = ((CEdit*)(m_A3dlg.GetDlgItem(IDC_LSTFLATINFO)));
edit->LineScroll(edit->GetLineCount());
assert(edit && edit->GetSafeHwnd());
edit->SetSel(edit->GetWindowTextLengthW(), edit->GetWindowTextLengthW());
edit->ReplaceSel(pWideChar);
//edit->LineScroll(edit->GetLineCount());
};
m_drv->SetFlatCallback(flatcall);
m_drv->StartFlat(((CButton*)GetDlgItem(IDC_CKBCORRECTMODE))->GetCheck());