loop i windows dialog
Jeg står og skal have noget kode opdateret hvert sekund i et edit felt i en dialog.Hvordan kunne man gøre dette. Jeg er ny i mfc/dialogs...så er i advareret
dette er koden der skal opdatere ved tryk på en knap
void CADRTestDlg::OnRead()
{
SetDlgItemText(IDC_STATUS,"Running");
g_sComPort = "Com3";
CComPort* pComPort = new CComPort(g_sComPort);
if (pComPort->Initialize())
{
pComPort->Read(m_sResults),
MessageBeep(-1);
pComPort->Terminate();
MessageBeep(-1);
// pComPort->Terminate();
}
else
{
m_sResults = "Setup failed";
} // end if
UpdateData(FALSE);
// push values out onto the screen // TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
} // end CADRTestDlg::OnRead