Click here to Skip to main content
13,042,421 members (137,776 online)
Rate this:
Please Sign up or sign in to vote.
See more:

How to SetTimer for a Win32 console application for a period of 3 months.

When 3 Months completed it should stop the application to run.

We need to remind that its not a continuos running application.

Can anyone help regarding this issue.

Thanks in Advance.
Posted 2-Sep-12 16:39pm
Kumar 091.2K
Wes Aday 2-Sep-12 22:43pm
A timer is set in milliseconds so just do the math. And a timer for a interval of 3 months screams bad design. Why don't you just check to see if the date is 3 months from when you started your app?
Member 9197184 2-Sep-12 22:53pm
i am new to timers can u give me a sample code. i had been trying hard for this but i couldn't get it. any sample code.
Wes Aday 4-Sep-12 22:47pm
Reading the documentation is a real good place to start,
pasztorpisti 3-Sep-12 3:29am
When the user starts your program you have to save the time of the first start to some evil hard to find place (registry). Consequent successful program starts should always check if the 3 month period has passed and the first time you detect this you should save a flag indicating the end of the period to your evil hidden place to prevent the users from using your program by setting the clock back a few weeks. The functions you should use are already mentioned below in the answer list.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

How about something like this:[^]

And in your program use this:[^]

and call to see the current date. You could store the last date in a txt file:[^][^]

anything else? ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 2 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100