我使用编辑控件在MFC中显示输入值。该值在while循环中用于计算其他参数。使用EN_CHANGE更新数据值时,我不能使用浮点输入数。如何在点击" Enter"之后实际更改该值。键?
float m_ini_gainG; // m_ini_gainG is value of edit Control.
void CMy0Dlg::OnClickedPlay()
{
m_thread = AfxBeginThread(MainThread,this);
}
UINT CMy01Dlg::MainThread(LPVOID pParam)
{
CMy01Dlg *pMainDlg = (CMy01BayerToRGBDlg*)pParam;
while(1)
{
pMainDlg->m_iTimer = pMainDlg->SetTimer(DISPLAY, 10, 0);
}
return 0;
}
void CMy01BayerToRGBDlg::OnTimer(UINT_PTR nIDEvent)
{
if(nIDEvent == DISPLAY)
{
Read(data); // data is read continuously
......
gainB = temp_G*m_ini_gainG/temp_B;
m_gainB.Format(L"%0.2f",gainB);
UpdateData(FALSE);
}
CDialogEx::OnTimer(nIDEvent);
}
void CMy01BayerToRGBDlg::OnChangeIniG()
{
UpdateData(TRUE);
}
我只能为m_ini_gainG设置整数值。我无法进入"。"设置浮动值。