HELP with system time 
Author Message
 HELP with system time

I need to get the system time and update that value to a control every
second. I am not sure how to approach it. This function will get the
system time and update the control but not every second. The buffer was
declared and the Time.h header was included.

void CAlarmDlg::UpdateTime()
{
    // store the system time in the buffer
 _strtime(timebuf);

    // copy buffer to the string variable
 CAlarmDlg::m_SysTime = timebuf;

    // update the edit control (read only)
 SetDlgItemText(IDC_SYSTEM_TIME, m_SysTime);

Quote:
}

Thanks.


Wed, 14 Nov 2001 03:00:00 GMT  
 HELP with system time

Quote:

> I need to get the system time and update that value to a control every
> second. I am not sure how to approach it. This function will get the
> system time and update the control but not every second.

Call SetTimer with 1000 milliseconds.  Then put in a message handler for WM_TIMER.  It will get called about once a second.  Call KillTimer when quitting.


Wed, 14 Nov 2001 03:00:00 GMT  
 HELP with system time
Thanks, I'll give it a try.


|
| >
| > I need to get the system time and update that value to a control
every
| > second. I am not sure how to approach it. This function will get the
| > system time and update the control but not every second.
|
| Call SetTimer with 1000 milliseconds.  Then put in a message handler
for WM_TIMER.  It will get called about once a second.  Call KillTimer
when quitting.



Thu, 15 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help setting System Time

2. Help setting System Time

3. icon in the taskbar notification area(where we see the system time) (Urgent Help)

4. Need Help: random # from system time

5. Help needed: COM in REAL-TIME systems.

6. Minimum Wait Time (System Time Resolution)

7. Correct time counting when system time is changing

8. OSP (Operating System Project) HELP HELP HELP HELP (files module)

9. How to get system idle time or get notified after the system being idle for an extended time

10. How to get system idle time or get notified after the system being idle for an extended time

11. Help using time.h to calculate running time...

12. Gurus...Unix serial-port, time-slice and timing help

 

 
Powered by phpBB® Forum Software