Timer after Jan 18, 2038

Does anybody know how does the SetTimer function work 
internally? I was told that not all timers can work 
properly when it reaches the date Jan 18, 2038 (overflow). 
Any idea?

Thanks!

UINT SetTimer(
  HWND hWnd,              // handle of window for timer 
messages
  UINT nIDEvent,          // timer identifier
  UINT uElapse,           // time-out value
  TIMERPROC lpTimerFunc   // address of timer procedure
);
 
0
anonymous (74725)
12/5/2003 12:16:04 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
560 Views

Similar Articles

[PageSpeed] 45

RB wrote:

> Does anybody know how does the SetTimer function work 
> internally? I was told that not all timers can work 
> properly when it reaches the date Jan 18, 2038 (overflow). 
> Any idea?
> 
> Thanks!
> 
> UINT SetTimer(
>   HWND hWnd,              // handle of window for timer 
> messages
>   UINT nIDEvent,          // timer identifier
>   UINT uElapse,           // time-out value
>   TIMERPROC lpTimerFunc   // address of timer procedure
> );
>  

There are timers and then there are timers.  The 2038 issue is about 
date/time values, which are absolute.  It is unrelated to SetTimer, 
which is an interval timer that deals only with elapsed time.  Kind of 
like the difference bewteen a calendar and a stopwatch.  No matter what 
funky things happen to the calendar each year, the stopwatch keeps right 
on working the same.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp1 (239)
12/5/2003 2:25:05 AM
Thanks for your clarification! That's what I thought too. 
But I was told that there are different types of timers 
which use different ways to do their task. Some timers do 
as what you have suggested. Some timers use the current 
time as the start time, and then add the elapsed time, and 
then keep track of the current time to see if it has 
reached the target time or not. If a timer uses this 
mechanism, then it would be a problem. I was just trying 
to clarify if SetTimer uses which machanism.

Thanks!

>-----Original Message-----
>RB wrote:
>
>> Does anybody know how does the SetTimer function work 
>> internally? I was told that not all timers can work 
>> properly when it reaches the date Jan 18, 2038 
(overflow). 
>> Any idea?
>> 
>> Thanks!
>> 
>> UINT SetTimer(
>>   HWND hWnd,              // handle of window for timer 
>> messages
>>   UINT nIDEvent,          // timer identifier
>>   UINT uElapse,           // time-out value
>>   TIMERPROC lpTimerFunc   // address of timer procedure
>> );
>>  
>
>There are timers and then there are timers.  The 2038 
issue is about 
>date/time values, which are absolute.  It is unrelated to 
SetTimer, 
>which is an interval timer that deals only with elapsed 
time.  Kind of 
>like the difference bewteen a calendar and a stopwatch.  
No matter what 
>funky things happen to the calendar each year, the 
stopwatch keeps right 
>on working the same.
>
>-- 
>Scott McPhillips [VC++ MVP]
>
>.
>
0
anonymous (74725)
12/5/2003 6:47:58 PM
RB wrote:

> Thanks for your clarification! That's what I thought too. 
> But I was told that there are different types of timers 
> which use different ways to do their task. Some timers do 
> as what you have suggested. Some timers use the current 
> time as the start time, and then add the elapsed time, and 
> then keep track of the current time to see if it has 
> reached the target time or not. If a timer uses this 
> mechanism, then it would be a problem. I was just trying 
> to clarify if SetTimer uses which machanism.
> 
> Thanks!
> 

Since you are aware of the basic difference I'll try to offer a more 
accurate answer.  The implementation of SetTimer is not public, so I 
don't really know for sure.  But the 2038 problem is unique to the 
particular representation of absolute time used in the C runtime 
library.  We know from many Windows API's that Windows uses a different 
representation internally.  (Probably the FILETIME struct.)  So the two 
seem unrelated and it would be a terrible coincidence, and surprisingly 
inefficient, if the SetTimer implementation had the 2038 problem.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp1 (239)
12/5/2003 10:46:21 PM
Reply:

Similar Artilces:

Timer of Form
Hi Guys, I need help in showing a timer value in a text box as well the user can still operate a form within the database, whilst the counter is counting down. I want ot be able to set a variable timer say to 30 seconds and be able to update text boxes within a form. I don't know if it is possible to update the form whilst the timer is runnig?? Does anyone have a pre made timer such as this?? many thansk for your help in advance!! Cheers, On Mon, 26 Apr 2010 22:31:01 -0700, DontKnow <DontKnow@discussions.microsoft.com> wrote: >Hi Guys, > >I nee...

macros #18
Can anyone advise me how i would write a macro to show the followin colourised in a spreadsheet �Cold� Crime is more than 2 SDs below the mean �Cool� Crime is between 1 and 2 SDs below the mean �Normal� Crime is between 1 SD below the mean and 1 SD above the mean �Warm� Crime is between 1 and 2 SDs above the mean �Hot� Crime is more than 2 SDs above the mean SD = standard deviation -- Message posted from http://www.ExcelForum.com Details are lacking. Have the mean and SD been calculated already? What colors are you wanting to use (or is it sufficient to return the specified text? Where...

Installation 11-18-03
Can someone give some help here... im installing (or=20 trying at this point) the CRM server, i do the following=20 steps: 1- Install O.S. (Windows server 2003) 2- Install all related services (IIS,SMTP,Msg=20 Queeuing,NNTP,Indexing srvs) 3- Install Exchange 2003 4- Install SQL 2000 5- Apply SP3 for SQL 6- Create a New OU 7- Create a New User with admin rights (alllllll the=20 permissions and rights possible in allll the=20 servers ,win,Exch,Sql) 8- Log on with that USer 9- Install CRM 10- Reboot teh computer 11- Re-register the crm security service 12- add the CRM licence Until this point ev...

have "2 timers" in one form, possible?
I have a form, but i need different timers 1) for updating Elapsed time every second (1000ms) 2) Auto Update a query every 20 Minutes (20000ms) 3) User Log-off time session 1 hour (60000 ms) How can that be done? Dear expert, thanks a lot! -- Allen Phailat Wongakanit Create a form-level variable (i.e. one declared in the General Declarations section of the form's module), e.g.: Private mdtFormOpen As Date Assign the time the form was opened to it: Private Sub Form_Open(Cancel As Integer) mdtFormOpen = Now() End Sub In the form's timer event, test the nu...

Outlook calendar 11-18-09
How can I save calendar entries more than 3 years of info. Data auto erases after 3 years. "Dendeeman" <Dendeeman@discussions.microsoft.com> wrote in message news:720ED272-23C7-4C67-A3F1-3E8C0A553C71@microsoft.com... > How can I save calendar entries more than 3 years of info. Data auto erases > after 3 years. Unless you have a rule that deletes them, you have autoarchive enabled, or you have a hand-held device deleting them, past events are kept forever. Which is the case for you? -- Brian Tillman [MVP-Outlook] ...

timers
Is there any limit on the number of timers i can use in a program ? I think, it is not. But it is not guaranteed that a timer will come in its time. If the system has to administrate to many threads it can swallow some timer events. Ralf www.oop-trainer.de If you are using "regular" timers I don't think so. However if you are using multimedia timers there is a limitation of 16 if I remeber correctly. /Magnus "srinivas" <srinu001@hotmail.com> skrev i meddelandet news:emHrvGWkDHA.3504@TK2MSFTNGP11.phx.gbl... > Is there any limit on the number of ti...

Sharepoint 02-18-05
In relation to integration of sharepoint with mscrm, how do you go about doing the install with sharepoint (sorry a bit off topic)? How do you go about installing these services in a medium deployment, when the AD is windows server 2003 and the crm is 2000 server - using Action pack software? Can you put Windows Sharepoint services or the Portal software on the crm server ( It seems to indicate not, as sharepoint portal requires windows 2003)? Do you need both these programs installed to get sharepoint to be capable for users? It seems like SharePoint Portal Server does everything so I am ...

Please Consult Before Posting: Unofficial FAQ Available #18
An unofficial FAQ for this newsgroup is available at http://umpmfaq.info. The source FAQ was last updated Tuesday, April 20, 2004. You may save yourself and those willing to spend their time helping you both time and hassle by consulting this resource before posting what may already be a FAQ. The unofficial FAQ answers 131 of the most frequently asked questions in this newsgroup. Likewise, a comprehensive archive of this newsgroup is available at http://groups.google.com. Click on Advanced Groups Search; there you should specify newsgroup microsoft.public.money and some search terms you consi...

CRM REPORTS 01-18-07
Hi everyone. I've created reports using Reporting Services. I then imported these reports into CRM as part of a CRM development for a client. The client accesses our CRM website through the internet, using an ip address. They are then prompted for their credentials, which they then enter. They can successfully enter CRM, but cannot access our custom reports, however, they can access the standard CRM reports. I've successfully accessed CRM and the reports via the internet, using their credentials. Basically, I can access everything from my side, but they can only access CRM and ...

Variable of Timer ?
I added a timer by overwriting OnTimer: void CTestPhasePPMDlg::OnTimer(UINT_PTR nIDEvent) { CDialog::OnTimer(nIDEvent); } I can Set the timer with SetTimer(1, 2000, NULL); but how shall I kill the timer with KillTimer(...); if I do not know the variable of the timer? Or how do I have to set that on up? Matthias On Wed, 18 Apr 2007 10:48:12 +0200, Matthias Pospiech <matthias79@gmx.de> wrote: >I added a timer by overwriting OnTimer: > >void CTestPhasePPMDlg::OnTimer(UINT_PTR nIDEvent) >{ > CDialog::OnTimer(nIDEvent); >} > >I can Set the timer with >SetTim...

Timer or not Timer
To view the data in a grid using the method refresh the grid with timer. And 'can display data without using a timer, but sending them to the source without refreshing? The data to be displayed are inserted into a MySQL database. The grid is updated with a reference count. Whenever I question the counter to see if new records have arrived. I can indicate an 'alternative? Thank you. Try reading through this article: http://msdn.microsoft.com/en-us/magazine/cc164015.aspx Comparing the Timer Classes in the .NET Framework Class Library "win" <...

requery on timer? does this make sense?
I have a pie-chart on my main menu; the main menu cannot close, it only becomes invisible. How do I requery the pie-chart to show new data when a new workorder is added to the system? Should this be done using a timer or is there a better way? I've tried to requery on the got focus event, but that didn't seem to work. If you have any ideas, I'd be grateful. Jason ...

Pivot tables #18
Hi Is there a way that I can set up several Pivot tables all usig a single source of data and then if I refresh one it will automatically refresh all the other pivots Thanks ...

Setting up Windows Mail 05-18-10
Using Windows Vista, Toshiba computer. The following error message was provided: The connection to the server has failed. Acount: "Windows Mail", Server: 110, Protocol: POP3, Port: 110, Secure (SSL): No, Socket Error: 10061, Error Number: 0x800CCCOE My website people said my mail Incoming Mail Server is mail.yourdomain.com Is that the same as the Incoming mail port, which is suppose to be 110 Thank you. Thanks. "110" is not a valid mail server name.=20 Who are these mysterious "website people"? I take it they are the web = hostin...

Thread and Timer
Hi, I'd like to use a timer inside a thread (CWinThread derived class). If I use the CALLBACK procedure I get the timer, if I don't use the CALLBACK and handle in OnTimer I never get the message. Here is the code: // WatchDog.cpp : implementation file // #include "stdafx.h" #include "xcrashreport.h" #include "WatchDog.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CString g_sFileName; HWND g_hWnd; UINT g_iMessage; UINT g_iTimer; UINT g_iTimerTimeout; ////////////////////////////////////////////////...

Timers and Threads
Hello, I have a class in which I use System.Threading.Timer. The callback function should send a message using TCPClient. Since the Callback function is in an another thread this doesn't work! How do I Invoke a function in the class thread from the callback function? The Class is not a Form class! // Anders -- English is not my first language so any error, insults or strangeness has happend during the translation. Please correct my English so that I may become better at it! Anders Eriksson wrote: > Hello, > > I have a class in which I use System.Thre...

MSFlexgrid Scrolling 11-18-09
I have an application that overlays text boxes on a flexgrid for data entry. The user clicks on the first empty row and enters data. Then the data is written to the grid row This is fine until the grid goes past the bottom of the grid. Then things get messy and no more entry is allowed by the control because the calculated row position is beyond the lower edge of the control. (Does that make sense to anyone?) What I want to do is, at this bottom point, is to scroll the grid up so that the next empty row is on the bottom grid row, and have the scrolling continue until data entry is...

Timer
Hi all, I would like to put a timer object on a form with start and stop buttons. so I can see how much time has elapsed. Any ideas? TIA, Tom On Mon, 5 Nov 2007 10:55:15 -0500, Tom wrote: > Hi all, > > I would like to put a timer object on a form with start and stop buttons. > so I can see how much time has elapsed. > > Any ideas? > > TIA, > > Tom If that's all you wish to do you don't need to use the timer. Nor do you need 2 command buttons. Add a text control. Name this one "StartTime" Add another control. Name this one "End...

Money 2000 2K+1 No Longer Supports Online Banking after 31 Jan
Received a note from our bank today saying Money 2K will no longer support online banking services as of January 31st. Not clear as to the implications of that. I am guessing that Microsoft will no longer provide software updates as necessary but Money 2K will still allow online banking. Or...does this mean that the software can no longer be used for online banking after 31 January. The bank is implying the latter, but that sounds a little harsh and, of course, the notice is rather short. Can anyone here clarify? It may well mean that the bank is dropping OFC (or similar) protocol that ...

CRM 3.0 Exchange Router Issue 01-18-06
Hi all, We have recently upgraded from version 1.2 to version 3.0 and our CRM installation is working fine. However we can not get the CRM Exchange E-Mail router installed. During the system requirement checks, we get a "warning" at stage 2. The error states "Setup cannot log on to the Microsoft CRM server. This might indicate that the server is down, or that you are not a Microsoft CRM user. (SOAP Server Application Faulted)" Our installation matches all prerequisites out of the Installation guide but we still get this error message. I have tried a reinstall of ...

Timer Class
Experimenting with a timer class. The main loop looks like this. Private Sub TimerLoop() Do While Not m_bEnabled = False If GetTickCount - m_lTickCount >= m_lInterval Then RaiseEvent OnTimer m_lTickCount = GetTickCount ElseIf GetTickCount = 0 Then m_lTickCount = 0 ElseIf GetTickCount < m_lTickCount Then m_lTickCount = 0 End If DoEvents Sleep 1& Loop End Sub I added the Sleep because the original code pushed the CPU useage to over 50% for this sub running. I...

Love Potion for Miss Blandish #18
yada yada hi darmasya, glanil,bavati bharata, agydanam adarmasya, kridadmanam padarmasya, Yet another fan Of mahabharata here anyway is this serial still on TV. -- ----------------------------------- "i think this will Help" With Regards Alok Gupta Visit me at http://www.thisisalok.tk "The God of Love" <kamraj123@rocketmail.com> wrote in m11essage news:epRA8uM3EHA.3000@TK2MSFTNGP15.phx.gbl... > > yada yada hi darmasya, > glanil,bavati bharata, > agydanam adarmasya, > kridadmanam padarmasya, ...

timer
i have an adc card, on trigger it acquires data. i have an application program which reads the data from the card. i realised that some triggers are missing. how do i write an win32 sequence of code, which executes a block for given seconds. i was comparing time(&t1) t2=t1+10; while(t2>t1) { captureAdcData(); noOfTrigger++; time(&t1); } still i need an efficient method so that it should not compare & loose the triggers. for few seconds data it should acquire & noOfTrigger/sec would give me trigger count. hope one would help me in getting right sequence for an ex...

CallOuts 07-18-07
....I'm so new to this whole CRM thing that I'm still trying to learn all the lingo. I keep seeing references to something called "CallOuts", but I'm unsure about exactly what those are. Can someone please explain, or point me to a posting or website that does an adequate jobe of explaining a callout? Thanks! -- Rusty Callouts are a programmatic way for you to plug in your own application logic. The CRM calls registered callouts when particular events occur in the CRM. The callouts are written in .Net 1.1 and registered on the CRM server. They are for progra...

timer
How can I do something on a timer-based level in a excel application. Like in "Visual Basic 6.0" one have a timer-object... -- Familie Mannens van de Manacker Nieuwdorp 103 9190 Stekene mailto:justin.mannens@telenet.be Have a look in vba help INDEX for TIMER -- Don Guillett SalesAid Software dguillett1@austin.rr.com "Mannens van de Manacker" <justin.mannens@telenet.be> wrote in message news:9%Urf.81342$BN6.5202037@phobos.telenet-ops.be... > How can I do something on a timer-based level in a excel application. > Like in "Visual Basic 6.0" ...