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!

I need help with setting a timer with MFC!!

Status
Not open for further replies.

BluShu

Programmer
Jan 20, 2002
5
0
0
US
How do i correctly set a timer, so that every 10 seconds it will read in a new set of text, until textfile has been completly read?? (using MFC).
 
You can use any of a set of options:
1-use SetTimer and give the address of a callback function that performs the read
2- use SetWaitableTimer and wait on it, each time the timer
is signalled, read what you need and return to wait (this must be in a separate thread)
You can also use the multimedia timer, but if the cycle is
10 secs you probably do not need such an accurate timer.

The read operation can be done via a CFile object intialized
to contain the appropriate FILE handle (by using either
the CFile methods or by obtaining the handle and calling Attach.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top