Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working a timer with MFC (kinda new with this)

Status
Not open for further replies.

BluShu

Programmer
Jan 20, 2002
5
0
0
US
Alright i need the timer to check my 2 files every ten seconds, and update the dialog box accordingly. The timer is to then shut off when all of the data is out of the data.txt file. I have attached the Dlg.cpp file. Can any one give me suggestions as to why my timer is not working..(Using MFC) If you need more code let me know.. Any suggestions will help!!



void CBldPressureDlg::OnTimer(UINT nIDEvent)
{
if(nIDEvent == SECONDS_TIMER)


{

CDialog::OnTimer(nIDEvent);


CString input;
CStdioFile dat;

dat.ReadString(input);

if(input.IsEmpty())
{
KillTimer(SECONDS_TIMER);
}

int find = input.Find("/");
m_systolicedit = input.Left(find);
m_diastolicedit = input.Mid(find +1);
}

return;
}



 
You need to start thee timer somewhere in the app. Maybe in the InitDialog or when the user clicks a button.

SetTimer(SECONDS_TIMER, 10000, NULL);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top